Part Number Hot Search : 
VGB8084A EUA2313B R5110510 7809A S21190HR D5141M R7200406 6KE12
Product Description
Full Text Search
 

To Download UPD78F0078 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 User's Manual
PD780078, 780078Y Subseries
8-Bit Single-Chip Microcontrollers
PD780076 PD780078 PD78F0078 PD780076Y PD780078Y PD78F0078Y
www..com
Document No. U14260EJ3V1UD00 (3rd edition) Date Published August 2004 N CP(K) 2000, 2003 Printed in Japan
[MEMO]
2
User's Manual U14260EJ3V1UD
NOTES FOR CMOS DEVICES
1 VOLTAGE APPLICATION WAVEFORM AT INPUT PIN Waveform distortion due to input noise or a reflected wave may cause malfunction. If the input of the CMOS device stays in the area between VIL (MAX) and VIH (MIN) due to noise, etc., the device may malfunction. Take care to prevent chattering noise from entering the device when the input level is fixed, and also in the transition period when the input level passes through the area between VIL (MAX) and VIH (MIN). 2 HANDLING OF UNUSED INPUT PINS Unconnected CMOS device inputs can be cause of malfunction. If an input pin is unconnected, it is possible that an internal input level may be generated due to noise, etc., causing malfunction. CMOS devices behave differently than Bipolar or NMOS devices. Input levels of CMOS devices must be fixed high or low by using pull-up or pull-down circuitry. Each unused pin should be connected to VDD or GND via a resistor if there is a possibility that it will be an output pin. All handling related to unused pins must be judged separately for each device and according to related specifications governing the device. 3 PRECAUTION AGAINST ESD A strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as much as possible, and quickly dissipate it when it has occurred. Environmental control must be adequate. When it is dry, a humidifier should be used. It is recommended to avoid using insulators that easily build up static electricity. Semiconductor devices must be stored and transported in an anti-static container, static shielding bag or conductive material. All test and measurement tools including work benches and floors should be grounded. The operator should be grounded using a wrist strap. Semiconductor devices must not be touched with bare hands. Similar precautions need to be taken for PW boards with mounted semiconductor devices. 4 STATUS BEFORE INITIALIZATION Power-on does not necessarily define the initial status of a MOS device. Immediately after the power source is turned ON, devices with reset functions have not yet been initialized. Hence, power-on does not guarantee output pin levels, I/O settings or contents of registers. A device is not initialized until the reset signal is received. A reset operation must be executed immediately after power-on for devices with reset functions.
EEPROM, FIP, and IEBus are trademarks of NEC Electronics Corporation. Windows and Windows NT are either registered trademarks or trademarks of Microsoft Corporation in the United States and/or other countries. PC/AT is a trademark of International Business Machines Corporation. HP9000 Series 700 and HP-UX are trademarks of Hewlett-Packard Company. SPARCstation is a trademark of SPARC International, Inc. Solaris and SunOS are trademarks of Sun Microsystems, Inc.
User's Manual U14260EJ3V1UD
3
These commodities, technology or software, must be exported in accordance with the export administration regulations of the exporting country. Diversion contrary to the law of that country is prohibited.
Purchase of NEC Electronics I2C components conveys a license under the Philips I2C Patent Rights to use these components in an I2C system, provided that the system conforms to the I2C Standard Specification as defined by Philips.
4
User's Manual U14260EJ3V1UD
* The information in this document is current as of August, 2004. The information is subject to change without notice. For actual design-in, refer to the latest publications of NEC Electronics data sheets or data books, etc., for the most up-to-date specifications of NEC Electronics products. Not all products and/or types are available in every country. Please check with an NEC Electronics sales representative for availability and additional information. * No part of this document may be copied or reproduced in any form or by any means without the prior written consent of NEC Electronics. NEC Electronics assumes no responsibility for any errors that may appear in this document. * NEC Electronics does not assume any liability for infringement of patents, copyrights or other intellectual property rights of third parties by or arising from the use of NEC Electronics products listed in this document or any other liability arising from the use of such products. No license, express, implied or otherwise, is granted under any patents, copyrights or other intellectual property rights of NEC Electronics or others. * Descriptions of circuits, software and other related information in this document are provided for illustrative purposes in semiconductor product operation and application examples. The incorporation of these circuits, software and information in the design of a customer's equipment shall be done under the full responsibility of the customer. NEC Electronics assumes no responsibility for any losses incurred by customers or third parties arising from the use of these circuits, software and information. * While NEC Electronics endeavors to enhance the quality, reliability and safety of NEC Electronics products, customers agree and acknowledge that the possibility of defects thereof cannot be eliminated entirely. To minimize risks of damage to property or injury (including death) to persons arising from defects in NEC Electronics products, customers must incorporate sufficient safety measures in their design, such as redundancy, fire-containment and anti-failure features. * NEC Electronics products are classified into the following three quality grades: "Standard", "Special" and "Specific". The "Specific" quality grade applies only to NEC Electronics products developed based on a customerdesignated "quality assurance program" for a specific application. The recommended applications of an NEC Electronics product depend on its quality grade, as indicated below. Customers must check the quality grade of each NEC Electronics product before using it in a particular application. "Standard": Computers, office equipment, communications equipment, test and measurement equipment, audio and visual equipment, home electronic appliances, machine tools, personal electronic equipment and industrial robots. "Special": Transportation equipment (automobiles, trains, ships, etc.), traffic control systems, anti-disaster systems, anti-crime systems, safety equipment and medical equipment (not specifically designed for life support). "Specific": Aircraft, aerospace equipment, submersible repeaters, nuclear reactor control systems, life support systems and medical equipment for life support, etc. The quality grade of NEC Electronics products is "Standard" unless otherwise expressly specified in NEC Electronics data sheets or data books, etc. If customers wish to use NEC Electronics products in applications not intended by NEC Electronics, they must contact an NEC Electronics sales representative in advance to determine NEC Electronics' willingness to support a given application. (Note) (1) "NEC Electronics" as used in this statement means NEC Electronics Corporation and also includes its majority-owned subsidiaries. (2) "NEC Electronics products" means any product developed or manufactured by or for NEC Electronics (as defined above).
M8E 02. 11-1
User's Manual U14260EJ3V1UD
5
Regional Information
Some information contained in this document may vary from country to country. Before using any NEC Electronics product in your application, pIease contact the NEC Electronics office in your country to obtain a list of authorized representatives and distributors. They will verify:
* * * * *
Device availability Ordering information Product release schedule Availability of related technical literature Development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, AC supply voltages, and so forth) Network requirements
*
In addition, trademarks, registered trademarks, export restrictions, and other legal issues may also vary from country to country. [GLOBAL SUPPORT] http://www.necel.com/en/support/support.html
NEC Electronics America, Inc. (U.S.)
Santa Clara, California Tel: 408-588-6000 800-366-9782
NEC Electronics (Europe) GmbH
Duesseldorf, Germany Tel: 0211-65030
* Sucursal en Espana
NEC Electronics Hong Kong Ltd.
Hong Kong Tel: 2886-9318
NEC Electronics Hong Kong Ltd.
Seoul Branch Seoul, Korea Tel: 02-558-3737
Madrid, Spain Tel: 091-504 27 87
* Succursale Francaise
Velizy-Villacoublay, France Tel: 01-30-67 58 00
* Filiale Italiana
NEC Electronics Shanghai Ltd.
Shanghai, P.R. China Tel: 021-5888-5400
Milano, Italy Tel: 02-66 75 41
* Branch The Netherlands
NEC Electronics Taiwan Ltd.
Taipei, Taiwan Tel: 02-2719-2377
Eindhoven, The Netherlands Tel: 040-244 58 45
* Tyskland Filial
NEC Electronics Singapore Pte. Ltd.
Novena Square, Singapore Tel: 6253-8311
Taeby, Sweden Tel: 08-63 80 820
* United Kingdom Branch
Milton Keynes, UK Tel: 01908-691-133
J04.1
6
User's Manual U14260EJ3V1UD
INTRODUCTION
Readers
This manual is intended for user engineers who wish to understand the functions of the
PD780078, 780078Y Subseries and design and develop application systems and
programs for these devices.
PD780078 Subseries:
PD780076, 780078, 78F0078
PD780078Y Subseries: PD780076Y, 780078Y, 78F0078Y
Purpose This manual is intended to give users an understanding of the functions described in the Organization below. Organization The PD780078, 780078Y Subseries manual is separated into two parts: this manual and the instructions edition (common to the 78K/0 Series).
PD780078, 780078Y
Subseries User's Manual (This Manual) * Pin functions * Internal block functions * Interrupts * Other on-chip peripheral functions * Electrical specifications
78K/0 Series Instructions User's Manual * CPU functions * Instruction set * Explanation of each instruction
How To Read This Manual It is assumed that the readers of this manual have general knowledge of electrical engineering, logic circuits, and microcontrollers. * To gain a general understanding of functions: Read this manual in the order of the CONTENTS. The mark points. * How to interpret the register format: For a bit number enclosed in a square, the bit name is defined as a reserved word in the RA78K0, and is defined as an sfr variable using the #pragma sfr directive in the CC78K0. * To check the details of a register when you know the register name: Refer to APPENDIX D REGISTER INDEX. * To know the details of the 78K/0 Series instruction functions: Refer to the 78K/0 Series Instructions User's Manual (U12326E). * To know the electrical specifications of the PD780078, 780078Y Subseries: Refer to CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDEDSPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078), CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y), and CHAPTER 27 SPECIFICATIONS (CONVENTIONAL PRODUCTS). ELECTRICAL shows major revised
User's Manual U14260EJ3V1UD
7
Differences Between PD780078 and 780078Y Subseries The configuration of the serial interface differs in PD780078 and 780078Y Subseries products.
Subseries Item Configuration of serial interface UART0 UART2/SIO3 CSI1 IIC0 1 ch 1 ch 1 ch None 1 ch 1 ch 1 ch 1 ch
PD780078 Subseries
PD780078Y Subseries
Chapter Organization
This manual divides the descriptions for the subseries into different chapters as shown below. Read only the chapters related to the device you are using.
Chapter
PD780078 Subseries
PD780078Y Subseries
--
Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7 Chapter 8 Chapter 9
Outline (PD780078 Subseries) Outline (PD780078Y Subseries) Pin Functions (PD780078 Subseries) Pin Functions (PD780078Y Subseries) CPU Architecture Port Functions Clock Generator 16-Bit Timer/Event Counters 00, 01 8-Bit Timer/Event Counters 50, 51 -- --
--
Chapter 10 Watch Timer Chapter 11 Watchdog Timer Chapter 12 Clock Output/Buzzer Output Controller Chapter 13 A/D Converter Chapter 14 Serial Interface UART0 Chapter 15 Serial Interface UART2 Chapter 16 Serial Interface SIO3 Chapter 17 Serial Interface CSI1 Chapter 18 Serial Interface IIC0 (PD780078Y Subseries only) Chapter 19 Interrupt Functions Chapter 20 External Device Expansion Function Chapter 21 Standby Function Chapter 22 Reset Function Chapter 23 PD78F0078, 78F0078Y Chapter 24 Instruction Set Chapter 25 Electrical Specifications (Expanded-Specification Products of PD780076, 780078, 78F0078) Chapter 26 Electrical Specifications (Expanded-Specification Products of PD780076Y, 780078Y, 78F0078Y) Chapter 27 Electrical Specifications (Conventional Products) Chapter 28 Package Drawings Chapter 29 Recommended Soldering Conditions -- -- --
8
User's Manual U14260EJ3V1UD
Conventions
Data significance: Note: Caution: Remark:
Higher digits on the left and lower digits on the right Footnote for item marked with Note in the text Information requiring particular attention Supplementary information *** xxxx or xxxxB *** xxxx *** xxxxH Decimal Hexadecimal
Active low representation: xxx (overscore over pin or signal name)
Numerical representation: Binary
Related Documents
The related documents indicated in this publication may include preliminary versions. However, preliminary versions are not marked as such.
Documents Related to Devices
Document Name Document No. This manual U12326E U12704E
PD780078, 780078Y Subseries User's Manual
78K/0 Series Instructions User's Manual 78K/0 Series Basics (I) Application Note
Documents Related to Development Tools (Software) (User's Manuals)
Document Name RA78K0 Assembler Package Operation Language Structured Assembly Language CC78K0 C Compiler Operation Language SM78K Series System Simulator Ver.2.30 or Later ID78K Series Integrated Debugger Ver.2.30 or Later Operation (WindowsTM Based) Document No. U14445E U14446E U11789E U14297E U14298E U15373E U15802E U15185E U14610E
External Part User Open Interface Specifications Operation (Windows Based)
Project Manager Ver.3.12 or Later (Windows Based)
Documents Related to Development Tools (Hardware) (User's Manuals)
Document Name IE-78K0-NS In-Circuit Emulator IE-78K0-NS-A In-Circuit Emulator IE-78K0-NS-PA Performance Board IE-780078-NS-EM1 Emulation Board IE-78001-R-A In-Circuit Emulator Document No. U13731E U14889E U16109E U16226E U14142E
Caution
The above documents are subject to change without prior notice. Be sure to use the latest version of each document for designing.
User's Manual U14260EJ3V1UD
9
Documents Related to Flash Memory Programming
Document Name PG-FP3 Flash Memory Programmer User's Manual PG-FP4 Flash Memory Programmer User's Manual Document No. U13502E U15260E
Other Documents
Document Name SEMICONDUCTOR SELECTION GUIDE - Products and Packages - Semiconductor Device Mount Manual Quality Grades on NEC Semiconductor Devices NEC Semiconductor Device Reliability/Quality Control System Guide to Prevent Damage for Semiconductor Devices by Electrostatic Discharge (ESD) Document No. X13769X Note C11531E C10983E C11892E
Note See the "Semiconductor Device Mount Manual" website (http://www.necel.com/pkg/en/mount/index.html). Caution The above documents are subject to change without prior notice. Be sure to use the latest version of each document for designing.
10
User's Manual U14260EJ3V1UD
CONTENTS
CHAPTER 1 OUTLINE (PD780078 SUBSERIES) ........................................................................ 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 Expanded-Specification Products and Conventional Products ...................................... Features ................................................................................................................................ Applications ......................................................................................................................... Ordering Information ........................................................................................................... Pin Configuration (Top View) .............................................................................................. 78K/0 Series Lineup ............................................................................................................. Block Diagram ...................................................................................................................... Outline of Functions ............................................................................................................ Mask Options .......................................................................................................................
19 19 20 21 21 22 24 26 27 28 29 29 30 31 31 32 34 36 37 38 39 39 42
42 42 42 43 44 44 44 45 46 46 46 46 46 46 46 46 46
CHAPTER 2 OUTLINE (PD780078Y SUBSERIES) ...................................................................... 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Expanded-Specification Products and Conventional Products ...................................... Features ................................................................................................................................ Applications ......................................................................................................................... Ordering Information ........................................................................................................... Pin Configuration (Top View) .............................................................................................. 78K/0 Series Lineup ............................................................................................................. Block Diagram ...................................................................................................................... Outline of Functions ............................................................................................................ Mask Options .......................................................................................................................
CHAPTER 3 PIN FUNCTIONS (PD780078 SUBSERIES) .......................................................... 3.1 3.2 Pin Function List .................................................................................................................. Description of Pin Functions ..............................................................................................
3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 P00 to P03 (Port 0) ................................................................................................................... P10 to P17 (Port 1) ................................................................................................................... P20 to P25 (Port 2) ................................................................................................................... P30 to P36 (Port 3) ................................................................................................................... P40 to P47 (Port 4) ................................................................................................................... P50 to P57 (Port 5) ................................................................................................................... P64 to P67 (Port 6) ................................................................................................................... P70 to P75 (Port 7) ................................................................................................................... P80 (Port 8) ...............................................................................................................................
3.2.10 AVREF ......................................................................................................................................... 3.2.11 AVSS .......................................................................................................................................... 3.2.12 RESET ...................................................................................................................................... 3.2.13 X1 and X2 ................................................................................................................................. 3.2.14 XT1 and XT2 ............................................................................................................................. 3.2.15 VDD0 and VDD1 ............................................................................................................................ 3.2.16 VSS0 and VSS1 ............................................................................................................................ 3.2.17 VPP (flash memory versions only) .............................................................................................
User's Manual U14260EJ3V1UD
11
3.2.18 IC (mask ROM version only) .....................................................................................................
47
3.3
Pin I/O Circuits and Recommended Connection of Unused Pins ...................................
48 52 52 55
55 55 55 56 57 57 57 58 59 59 59 59 59 59 59 59 59 60
CHAPTER 4 PIN FUNCTIONS (PD780078Y SUBSERIES) ......................................................... 4.1 4.2 Pin Function List .................................................................................................................. Description of Pin Functions ..............................................................................................
4.2.1 4.2.2 4.2.3 4.2.4 4.2.5 4.2.6 4.2.7 4.2.8 4.2.9 P00 to P03 (Port 0) ................................................................................................................... P10 to P17 (Port 1) ................................................................................................................... P20 to P25 (Port 2) ................................................................................................................... P30 to P36 (Port 3) ................................................................................................................... P40 to P47 (Port 4) ................................................................................................................... P50 to P57 (Port 5) ................................................................................................................... P64 to P67 (Port 6) ................................................................................................................... P70 to P75 (Port 7) ................................................................................................................... P80 (Port 8) ...............................................................................................................................
4.2.10 AVREF ......................................................................................................................................... 4.2.11 AVSS .......................................................................................................................................... 4.2.12 RESET ...................................................................................................................................... 4.2.13 X1 and X2 ................................................................................................................................. 4.2.14 XT1 and XT2 ............................................................................................................................. 4.2.15 VDD0 and VDD1 ............................................................................................................................ 4.2.16 VSS0 and VSS1 ............................................................................................................................ 4.2.17 VPP (flash memory versions only) ............................................................................................. 4.2.18 IC (mask ROM version only) .....................................................................................................
4.3
Pin I/O Circuits and Recommended Connection of Unused Pins ...................................
61 64 64
67 68 68 68 69
CHAPTER 5 CPU ARCHITECTURE ................................................................................................ 5.1 Memory Spaces ....................................................................................................................
5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 Internal program memory space ............................................................................................... Internal data memory space ..................................................................................................... Special function register (SFR) area ......................................................................................... External memory space ............................................................................................................ Data memory addressing .......................................................................................................... Control registers ........................................................................................................................ General-purpose registers ........................................................................................................ Special function registers (SFR) ............................................................................................... Relative addressing ................................................................................................................... Immediate addressing ............................................................................................................... Table indirect addressing .......................................................................................................... Register addressing .................................................................................................................. Implied addressing .................................................................................................................... Register addressing .................................................................................................................. Direct addressing ......................................................................................................................
5.2
Processor Registers ............................................................................................................
5.2.1 5.2.2 5.2.3
72
72 75 77
5.3
Instruction Address Addressing ........................................................................................
5.3.1 5.3.2 5.3.3 5.3.4
81
81 82 83 84
5.4
Operand Address Addressing ............................................................................................
5.4.1 5.4.2 5.4.3
85
85 86 87
12
User's Manual U14260EJ3V1UD
5.4.4 5.4.5 5.4.6 5.4.7 5.4.8 5.4.9
Short direct addressing ............................................................................................................. Special function register (SFR) addressing ............................................................................... Register indirect addressing ...................................................................................................... Based addressing ..................................................................................................................... Based indexed addressing ........................................................................................................ Stack addressing .......................................................................................................................
88 89 90 91 92 93
CHAPTER 6 PORT FUNCTIONS ..................................................................................................... 6.1 6.2 Port Functions ...................................................................................................................... Port Configuration ...............................................................................................................
6.2.1 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.2.8 6.2.9 Port 0 ......................................................................................................................................... Port 1 ......................................................................................................................................... Port 2 ......................................................................................................................................... Port 3 (PD780078 Subseries) ................................................................................................. Port 3 (PD780078Y Subseries) ............................................................................................... Port 4 ......................................................................................................................................... Port 5 ......................................................................................................................................... Port 6 ......................................................................................................................................... Port 7 .........................................................................................................................................
94 94 97
97 99 100 104 107 110 112 113 115 117
6.2.10 Port 8 .........................................................................................................................................
6.3 6.4
Port Function Control Registers ........................................................................................ 118 Port Function Operations .................................................................................................... 125
6.4.1 6.4.2 6.4.3 Writing to I/O port ...................................................................................................................... Reading from I/O port ............................................................................................................... Operations on I/O port .............................................................................................................. 125 125 125
6.5
Selection of Mask Option .................................................................................................... 126
CHAPTER 7 CLOCK GENERATOR ................................................................................................ 127 7.1 7.2 7.3 7.4 Clock Generator Functions ................................................................................................. Clock Generator Configuration .......................................................................................... Clock Generator Control Registers .................................................................................... System Clock Oscillator ......................................................................................................
7.4.1 7.4.2 7.4.3 Main system clock oscillator ...................................................................................................... Subsystem clock oscillator ........................................................................................................ When subsystem clock is not used ........................................................................................... Main system clock operations ................................................................................................... Subsystem clock operations ..................................................................................................... Time required for switchover between system clock and CPU clock ........................................ System clock and CPU clock switching procedure ...................................................................
127 127 129 133
133 134 137 139 140 140 141
7.5
Clock Generator Operations ............................................................................................... 138
7.5.1 7.5.2
7.6
Changing System Clock and CPU Clock Settings ............................................................ 140
7.6.1 7.6.2
CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01 ............................................................. 142 8.1 8.2 Functions of 16-Bit Timer/Event Counters 00, 01 ............................................................. 142 Configuration of 16-Bit Timer/Event Counters 00, 01 ....................................................... 143
User's Manual U14260EJ3V1UD
13
8.3 8.4
Registers to Control 16-Bit Timer/Event Counters 00, 01 ................................................ 148 Operation of 16-Bit Timer/Event Counters 00, 01 ............................................................. 158
8.4.1 8.4.2 8.4.3 8.4.4 8.4.5 Interval timer operation ............................................................................................................. External event counter operation .............................................................................................. Pulse width measurement operations ....................................................................................... Square-wave output operation .................................................................................................. PPG output operation ................................................................................................................ Interval timer ............................................................................................................................. Pulse width measurement by free-running counter and one capture register ........................... Two pulse widths measurement by free-running counter .......................................................... Pulse width measurement by restart ......................................................................................... PPG output ................................................................................................................................ 158 161 163 171 173 177 178 179 181 182
8.5
Program List ......................................................................................................................... 176
8.5.1 8.5.2 8.5.3 8.5.4 8.5.5
8.6
Cautions for 16-Bit Timer/Event Counters 00, 01 ............................................................. 183
CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 50, 51 ............................................................... 187 9.1 9.2 9.3 9.4 Functions of 8-Bit Timer/Event Counters 50, 51 ............................................................... Configuration of 8-Bit Timer/Event Counters 50, 51 ......................................................... Registers to Control 8-Bit Timer/Event Counters 50, 51 .................................................. Operation of 8-Bit Timer/Event Counters 50, 51 ...............................................................
9.4.1 9.4.2 9.4.3 9.4.4 9.4.5 8-bit interval timer operation ...................................................................................................... External event counter operation .............................................................................................. Square-wave output (8-bit resolution) operation ....................................................................... 8-bit PWM output operation ...................................................................................................... Interval timer (16-bit) operations ............................................................................................... Interval timer (8-bit) ................................................................................................................... External event counter .............................................................................................................. Interval timer (16-bit) .................................................................................................................
187 189 191 196
196 199 200 201 205 206 207 208
9.5
Program List ......................................................................................................................... 206
9.5.1 9.5.2 9.5.3
9.6
Cautions for 8-Bit Timer/Event Counters 50, 51 ............................................................... 209
CHAPTER 10 WATCH TIMER ......................................................................................................... 210 10.1 10.2 10.3 10.4 Watch Timer Functions ....................................................................................................... Watch Timer Configuration ................................................................................................. Register to Control Watch Timer ........................................................................................ Watch Timer Operations .....................................................................................................
10.4.1 Watch timer operation ............................................................................................................... 10.4.2 Interval timer operation .............................................................................................................
210 211 211 213
213 213
10.5 Cautions for Watch Timer ................................................................................................... 214 CHAPTER 11 WATCHDOG TIMER ................................................................................................. 215 11.1 11.2 11.3 11.4 Watchdog Timer Functions ................................................................................................. Watchdog Timer Configuration .......................................................................................... Registers to Control Watchdog Timer ............................................................................... Watchdog Timer Operations ............................................................................................... 215 216 216 218
14
User's Manual U14260EJ3V1UD
11.4.1 Watchdog timer operation ......................................................................................................... 11.4.2 Interval timer operation .............................................................................................................
218 219
CHAPTER 12 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER ........................................... 220 12.1 12.2 12.3 12.4 Clock Output/Buzzer Output Controller Functions .......................................................... Configuration of Clock Output/Buzzer Output Controller ................................................ Registers to Control Clock Output/Buzzer Output Controller ......................................... Operation of Clock Output/Buzzer Output Controller ......................................................
12.4.1 Operation as clock output ......................................................................................................... 12.4.2 Operation as buzzer output .......................................................................................................
220 221 221 224
224 224
CHAPTER 13 A/D CONVERTER ..................................................................................................... 225 13.1 13.2 13.3 13.4 A/D Converter Functions ..................................................................................................... A/D Converter Configuration .............................................................................................. Registers Used in A/D Converter ....................................................................................... A/D Converter Operation .....................................................................................................
13.4.1 Basic operations of A/D converter ............................................................................................. 13.4.2 Input voltage and conversion results ......................................................................................... 13.4.3 A/D converter operation mode ..................................................................................................
225 226 228 232
232 234 235
13.5 How to Read A/D Converter Characteristics Table ........................................................... 238 13.6 Cautions for A/D Converter ................................................................................................. 241 CHAPTER 14 SERIAL INTERFACE UART0 .................................................................................. 247 14.1 14.2 14.3 14.4 Functions of Serial Interface UART0 .................................................................................. Configuration of Serial Interface UART0 ........................................................................... Registers to Control Serial Interface UART0 ..................................................................... Operation of Serial Interface UART0 ..................................................................................
14.4.1 Operation stop mode ................................................................................................................. 14.4.2 Asynchronous serial interface (UART) mode ............................................................................ 14.4.3 Infrared data transfer mode .......................................................................................................
247 249 250 255
255 255 264
CHAPTER 15 SERIAL INTERFACE UART2 .................................................................................. 268 15.1 15.2 15.3 15.4 Functions of Serial Interface UART2 .................................................................................. Configuration of Serial Interface UART2 ........................................................................... Registers to Control Serial Interface UART2 ..................................................................... Operation of Serial Interface UART2 ..................................................................................
15.4.1 Operation stop mode ................................................................................................................. 15.4.2 Asynchronous serial interface (UART) mode ............................................................................ 15.4.3 Multi-processor transfer mode .................................................................................................. 15.4.4 Infrared data transfer (IrDA) mode ............................................................................................
268 270 272 281
281 282 297 303
CHAPTER 16 SERIAL INTERFACE SIO3 ...................................................................................... 310 16.1 Functions of Serial Interface SIO3 ..................................................................................... 310
User's Manual U14260EJ3V1UD
15
16.2 Configuration of Serial Interface SIO3 ............................................................................... 311 16.3 Registers to Control Serial Interface SIO3 ........................................................................ 311 16.4 Operation of Serial Interface SIO3 ...................................................................................... 314
16.4.1 Operation stop mode ................................................................................................................. 16.4.2 3-wire serial I/O mode ............................................................................................................... 314 315
CHAPTER 17 SERIAL INTERFACE CSI1 ...................................................................................... 318 17.1 17.2 17.3 17.4 Functions of Serial Interface CSI1 ...................................................................................... Configuration of Serial Interface CSI1 ............................................................................... Registers to Control Serial Interface CSI1 ......................................................................... Operation of Serial Interface CSI1 ......................................................................................
17.4.1 Operation stop mode ................................................................................................................. 17.4.2 3-wire serial I/O mode ...............................................................................................................
318 318 319 323
323 323
CHAPTER 18 SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY) ........................... 333 18.1 18.2 18.3 18.4 Functions of Serial Interface IIC0 ....................................................................................... Configuration of Serial Interface IIC0 ................................................................................. Registers to Control Serial Interface IIC0 .......................................................................... I2C Bus Mode Functions .....................................................................................................
18.4.1 Pin configuration ....................................................................................................................... 18.5.1 Start conditions ......................................................................................................................... 18.5.2 Addresses ................................................................................................................................. 18.5.3 Transfer direction specification .................................................................................................. 18.5.4 Acknowledge (ACK) signal ........................................................................................................ 18.5.5 Stop condition ........................................................................................................................... 18.5.6 Wait signal (WAIT) .................................................................................................................... 18.5.7 Interrupt request (INTIIC0) generation timing and wait control ................................................. 18.5.8 Address match detection method ............................................................................................. 18.5.9 Error detection ........................................................................................................................... 18.5.10 Extension code .......................................................................................................................... 18.5.11 Arbitration .................................................................................................................................. 18.5.12 Wake-up function ...................................................................................................................... 18.5.13 Communication reservation ...................................................................................................... 18.5.14 Other cautions ........................................................................................................................... 18.5.15 Communication operations ....................................................................................................... 18.5.16 Timing of I2C interrupt request (INTIIC0) occurrence ...............................................................
333 336 338 348
348 349 350 350 351 352 353 355 356 356 356 357 358 359 361 362 370
18.5 I2C Bus Definitions and Control Methods ......................................................................... 349
18.6 Timing Charts ....................................................................................................................... 388 CHAPTER 19 INTERRUPT FUNCTIONS ........................................................................................ 395 19.1 19.2 19.3 19.4 Interrupt Function Types ..................................................................................................... Interrupt Sources and Configuration ................................................................................. Interrupt Function Control Registers ................................................................................. Interrupt Servicing Operations ...........................................................................................
19.4.1 Non-maskable interrupt request acknowledgment operation ....................................................
395 395 400 406
406
16
User's Manual U14260EJ3V1UD
19.4.2 Maskable interrupt request acknowledgment operation ............................................................ 19.4.3 Software interrupt request acknowledgment operation ............................................................. 19.4.4 Multiple interrupt servicing ........................................................................................................ 19.4.5 Interrupt request hold ................................................................................................................
409 411 412 415
CHAPTER 20 EXTERNAL DEVICE EXPANSION FUNCTION ..................................................... 416 20.1 20.2 20.3 20.4 External Device Expansion Function ................................................................................. External Device Expansion Function Control Registers .................................................. External Device Expansion Function Timing .................................................................... Example of Connection with Memory ................................................................................ 416 418 420 425
CHAPTER 21 STANDBY FUNCTION .............................................................................................. 426 21.1 Standby Function and Configuration ................................................................................. 426
21.1.1 Standby function ....................................................................................................................... 21.1.2 Standby function control register ............................................................................................... 21.2.1 HALT mode ............................................................................................................................... 21.2.2 STOP mode .............................................................................................................................. 426 427 428 431
21.2 Standby Function Operations ............................................................................................. 428
CHAPTER 22 RESET FUNCTION ................................................................................................... 434 22.1 Reset Function ..................................................................................................................... 434 CHAPTER 23 PD78F0078, 78F0078Y ............................................................................................. 438 23.1 Memory Size Switching Register ........................................................................................ 439 23.2 Internal Expansion RAM Size Switching Register ............................................................ 440 23.3 Flash Memory Characteristics ............................................................................................ 441
23.3.1 Programming environment ........................................................................................................ 23.3.2 Communication mode ............................................................................................................... 23.3.3 On-board pin processing ........................................................................................................... 23.3.4 Connection of adapter for flash writing ...................................................................................... 441 442 445 448
CHAPTER 24 INSTRUCTION SET .................................................................................................. 452 24.1 Legend Used in Operation List ........................................................................................... 453
24.1.1 Operand identifiers and specification methods ......................................................................... 24.1.2 Description of "operation" column ............................................................................................. 24.1.3 Description of "flag operation" column ....................................................................................... 453 454 454
24.2 Operation List ....................................................................................................................... 455 24.3 Instructions Listed by Addressing Type ........................................................................... 463 CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078) ................................................... 467 CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y) ............................................ 498
User's Manual U14260EJ3V1UD
17
CHAPTER 27 ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS) ..................... 527 CHAPTER 28 PACKAGE DRAWINGS .............................................................................................. 556 CHAPTER 29 RECOMMENDED SOLDERING CONDITIONS ......................................................... 559 APPENDIX A DIFFERENCES BETWEEN PD78018F, 780024A, 780034A, AND 780078 SUBSERIES .......................................................................................... 561 APPENDIX B DEVELOPMENT TOOLS .......................................................................................... 564 B.1 B.2 B.3 B.4 B.5 Software Package ................................................................................................................ Language Processing Software ......................................................................................... Control Software .................................................................................................................. Flash Memory Writing Tools ............................................................................................... Debugging Tools (Hardware) ..............................................................................................
B.5.1 B.5.2 When using the in-circuit emulator IE-78K0-NS or IE-78K0-NS-A ............................................ When using the in-circuit emulator IE-78001-R-A .....................................................................
567 567 568 568 569
569 570
B.6
Debugging Tools (Software) ............................................................................................... 571
APPENDIX C NOTES ON TARGET SYSTEM DESIGN ................................................................... 575 APPENDIX D REGISTER INDEX ..................................................................................................... 580 D.1 D.2 Register Index (In Alphabetical Order with Respect to Register Names) ....................... 580 Register Index (In Alphabetical Order with Respect to Register Symbol) ..................... 583
APPENDIX E REVISION HISTORY ................................................................................................. 586 E.1 E.2 Major Revisions in This Edition .......................................................................................... 586 Revision History up to Previous Edition ........................................................................... 589
18
User's Manual U14260EJ3V1UD
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.1 Expanded-Specification Products and Conventional Products
The expanded-specification products and conventional products refer to the following products. Expanded-specification products: Products with a rankNote other than K Mask ROM and flash memory versions for which orders were received on or after February 1, 2002 Conventional products: Products with rankNote K Products other than the above expanded-specification products Note The rank is indicated by the 5th digit from the left in the lot number marked on the package.
Lot number
Year code Week code Rank
Expanded-specification products and conventional products differ in the operating frequency ratings. Table 1-1 shows the differences between these products. Table 1-1. Differences Between Expanded-Specification Products and Conventional Products
Power Supply Voltage (VDD) Guaranteed Operating Speed (Operating Frequency) Conventional Products 4.5 to 5.5 V 4.0 to 5.5 V 3.0 to 5.5 V 2.7 to 5.5 V 1.8 to 5.5 V 8.38 MHz (0.238 s) 8.38 MHz (0.238 s) 5 MHz (0.4 s) 5 MHz (0.4 s) 1.25 MHz (1.6 s) Expanded-Specification Products 12 MHz (0.166 s) 8.38 MHz (0.238 s) 8.38 MHz (0.238 s) 5 MHz (0.4 s) 1.25 MHz (1.6 s)
Remark The parenthesized values indicate the minimum instruction execution time.
User's Manual U14260EJ3V1UD
19
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.2 Features
*
Minimum instruction execution time changeable from high speed (expanded-specification products 0.166 s: @ 12 MHz operation with main system clock, conventional products 0.238 s: @ 8.38 MHz operation with main system clock) to ultra-low speed (122 s: @ 32.768 kHz operation with subsystem clock)
* *
General-purpose registers: 8 bits x 32 registers (8 bits x 8 registers x 4 banks) Internal memory
Type Part Number Program Memory (ROM) Mask ROM 48 KB 60 KB Flash memory 60 KBNote Data Memory High-Speed RAM 1024 bytes Expansion RAM 1024 bytes
PD780076 PD780078 PD78F0078
Note The capacity of the internal flash memory can be changed by means of the memory size switching register (IMS).
* *
External memory expansion space: 64 KB (on-chip external device expansion function) Instruction set suited to system control * Bit manipulation possible in all address spaces * Multiply and divide instructions
* *
52 I/O ports: (Four N-ch open-drain ports) Timer: 6 channels * 16-bit timer/event counter: 2 channels * 8-bit timer/event counter: * Watch timer: * Watchdog timer: 2 channels 1 channel 1 channel 3 channels 1 channel 1 channel
*
Serial interface: * 3-wire serial I/O mode: * UART mode:
* 3-wire serial I/O/UART mode selectable: 1 channel
* * * *
10-bit resolution A/D converter: 8 channels Vectored interrupt sources: 25 Two types of on-chip clock oscillators (main system clock and subsystem clock) Power supply voltage: VDD = 1.8 to 5.5 V
20
User's Manual U14260EJ3V1UD
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.3 Applications
Personal computers, air conditioners, dashboards, car audio, etc.
1.4 Ordering Information
Part Number Package 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) Internal ROM Mask ROM Mask ROM Mask ROM Mask ROM Mask ROM Mask ROM Flash memory Flash memory Flash memory
PD780076GC-xxx-8BS PD780076GC-xxx-AB8 PD780076GK-xxx-9ET PD780078GC-xxx-8BS PD780078GC-xxx-AB8 PD780078GK-xxx-9ET PD78F0078GC-8BS PD78F0078GC-AB8 PD78F0078GK-9ET
Remark xxx indicates ROM code suffix.
User's Manual U14260EJ3V1UD
21
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.5 Pin Configuration (Top View)
* 64-pin plastic LQFP (14 x 14) * 64-pin plastic QFP (14 x 14) * 64-pin plastic TQFP (12 x 12)
P75/BUZ/TI001/TO01
P74/PCL/TI011
P73/TI51/TO51
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 P50/A8 P51/A9 P52/A10 P53/A11 P54/A12 P55/A13 P56/A14 P57/A15 VSS0 VDD0 P30 P31 P32 P33 P34/SI3/TXD2 P35/SO3/RXD2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 P71/TI010 P70/TI000/TO00 P03/INTP3/ADTRG P02/INTP2 P01/INTP1 P00/INTP0 VSS1 X1 X2 IC (VPP) XT1 XT2 RESET P80/SS1 AVREF P10/ANI0
P36/SCK3/ASCK2
P17/ANI7
P16/ANI6
P15/ANI5
P14/ANI4
P13/ANI3
P12/ANI2
P23/RxD0
P24/TxD0
P25/ASCK0
P22/SCK1
Cautions 1. Connect the IC (internally connected) pin directly to VSS0 or VSS1. 2. Connect the AVSS pin to VSS0. Remarks 1. When these devices are used in applications that require the reduction of noise generated from an on-chip microcontroller, the implementation of noise measures is recommended, such as supplying VDD0 and VDD1 independently, connecting VSS0 and VSS1 independently to ground lines, and so on. 2. Pin connection in parentheses is intended for the PD78F0078.
22
User's Manual U14260EJ3V1UD
P11/ANI1
P20/SI1
P21/SO1
VDD1
AVSS
P72/TI50/TO50
P67/ASTB
P66/WAIT
P47/AD7
P46/AD6
P45/AD5
P44/AD4
P43/AD3
P42/AD2
P41/AD1
P40/AD0
P65/WR
P64/RD
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
A8 to A15: AD0 to AD7: ADTRG: ANI0 to ANI7: ASCK0, ASCK2: ASTB: AVREF: AVSS: BUZ: IC: INTP0 to INTP3: P00 to P03: P10 to P17: P20 to P25: P30 to P36: P40 to P47: P50 to P57: P64 to P67: P70 to P75: P80:
Address bus Address/data bus AD trigger input Analog input Asynchronous serial clock Address strobe Analog reference voltage Analog ground Buzzer clock Internally connected External interrupt input Port 0 Port 1 Port 2 Port 3 Port 4 Port 5 Port 6 Port 7 Port 8
PCL: RD: RESET: RXD0, RXD2: SCK1, SCK3: SI1, SI3: SO1, SO3: SS1: TI000, TI010, TI001, TI011, TI50, TI51: TO00, TO01, TO50, TO51: TXD0, TXD2: VDD0, VDD1: VPP: VSS0, VSS1: WAIT: WR: X1, X2: XT1, XT2:
Programmable clock Read strobe Reset Receive data Serial clock Serial input Serial output Serial interface chip select input Timer input Timer output Transmit data Power supply Programming power supply Ground Wait Write strobe Crystal (main system clock) Crystal (subsystem clock)
User's Manual U14260EJ3V1UD
23
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.6 78K/0 Series Lineup
The 78K/0 Series product lineup is illustrated below. Part numbers in the boxes indicate subseries names.
Products in mass production Products under development
Y subseries products are compatible with I2C bus. Control 100-pin 100-pin 100-pin 100-pin 80-pin 80-pin 80-pin 80-pin 64-pin 64-pin 64-pin 52-pin 52-pin 64-pin 64-pin 42/44-pin
PD78075B PD78078 PD78070A PD780058 PD78058F PD78054 PD780065 PD780078 PD780034A PD780024A PD780034AS
PD780024AS PD78014H
EMI-noise reduced version of the PD78078
PD78078Y PD78070AY PD780018AY PD780058Y PD78058FY PD78054Y
PD78054 with timer and enhanced external interface
ROMless version of the PD78078 PD78078Y with enhanced serial I/O and limited functions
PD78054 with enhanced serial I/O
EMI-noise reduced version of the PD78054
PD78018F with UART and D/A converter, and enhanced I/O PD780024A with expanded RAM PD780034A with timer and enhanced serial I/O PD780078Y PD780034AY PD780024A with enhanced A/D converter PD780024AY PD78018F with enhanced serial I/O 52-pin version of the PD780034A
52-pin version of the PD780024A EMI-noise reduced version of the PD78018F
PD78018F PD78083
Inverter control
PD78018FY
Basic subseries for control On-chip UART, capable of operating at low voltage (1.8 V)
64-pin
PD780988
VFD drive
On-chip inverter control circuit and UART. EMI-noise reduced.
100-pin 80-pin 80-pin 80-pin
PD780208 PD780232 PD78044H PD78044F
LCD drive
PD78044F with enhanced I/O and VFD C/D. Display output total: 53
For panel control. On-chip VFD C/D. Display output total: 53
PD78044F with N-ch open-drain I/O. Display output total: 34
Basic subseries for driving VFD. Display output total: 34
78K/0 Series
100-pin 100-pin 120-pin 120-pin 120-pin 100-pin 100-pin 100-pin
PD780354 PD780344 PD780338 PD780328 PD780318 PD780308 PD78064B PD78064
PD780354Y PD780344Y
PD780344 with enhanced A/D converter PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer.
Segment signal output: 40 pins max. Segment signal output: 40 pins max. Segment signal output: 32 pins max. Segment signal output: 24 pins max.
PD780308Y PD78064Y
PD78064 with enhanced SIO, and expanded ROM and RAM EMI-noise reduced version of the PD78064
Basic subseries for driving LCDs, on-chip UART
Bus interface supported 100-pin 80-pin 80-pin 80-pin 80-pin 64-pin
PD780948 PD78098B PD780702Y PD780703AY PD780833Y
PD780816
Meter control
On-chip CAN controller
PD78054 with IEBusTM controller
On-chip IEBus controller On-chip CAN controller On-chip controller compliant with J1850 (Class 2) Specialized for CAN controller function
100-pin 80-pin 80-pin
PD780958 PD780852 PD780828B
For industrial meter control On-chip automobile meter controller/driver For automobile meter driver. On-chip CAN controller
Remark VFD (Vacuum Fluorescent Display) is referred to as FIPTM (Fluorescent Indicator Panel) in some documents, but the functions of the two are the same.
24
User's Manual U14260EJ3V1UD
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
The major functional differences between the subseries are shown below. * Subseries without the suffix Y
Function Subseries Name Control ROM Capacity Timer 8-Bit 10-Bit 8-Bit A/D - D/A 2 ch 3 ch (UART: 1 ch) 88 Serial Interface I/O VDD External MIN. Value Expansion 1.8 V Yes
8-Bit 16-Bit Watch WDT A/D 4 ch 1 ch 1 ch 1 ch 8 ch
PD78075B 32 KB to 40 KB PD78078 PD78070A
48 KB to 60 KB -
61 2 ch 3 ch (time-division UART: 1 ch) 3 ch (UART: 1 ch) 68 69
2.7 V 1.8 V 2.7 V 2.0 V
PD780058 24 KB to 60 KB PD78058F 48 KB to 60 KB PD78054
16 KB to 60 KB
PD780065 40 KB to 48 KB PD780078 48 KB to 60 KB
PD780034A 8 KB to 32 KB PD780024A
PD780034AS PD780024AS
2 ch 1 ch 8 ch - 4 ch 8 ch - 4 ch - - 8 ch
-
4 ch (UART: 1 ch) 3 ch (UART: 2 ch) 3 ch (UART: 1 ch)
60 52 51
2.7 V 1.8 V
39
-
PD78014H PD78018F 8 KB to 60 KB PD78083
Inverter control VFD drive 8 KB to 16 KB - 3 ch Note - - 1 ch
2 ch
53
Yes
1 ch (UART: 1 ch) - 8 ch - 3 ch (UART: 2 ch)
33 47 4.0 V
- Yes
PD780988 16 KB to 60 KB PD780208 32 KB to 60 KB PD780232 16 KB to 24 KB PD78044H 32 KB to 48 KB PD78044F 16 KB to 40 KB
2 ch 3 ch 2 ch
1 ch - 1 ch
1 ch - 1 ch
1 ch
8 ch 4 ch 8 ch
-
-
2 ch
74 40
2.7 V 4.5 V 2.7 V
-
1 ch 2 ch
68
LCD drive
PD780354 24 KB to 32 KB PD780344 PD780338 48 KB to 60 KB PD780328 PD780318 PD780308 48 KB to 60 KB PD78064B 32 KB PD78064
16 KB to 32 KB
4 ch
1 ch
1 ch
1 ch
- 8 ch
8 ch -
-
3 ch (UART: 1 ch)
66
1.8 V
-
3 ch
2 ch
-
10 ch 1 ch 2 ch (UART: 1 ch)
54 62 70
2 ch
1 ch
8 ch
-
-
3 ch (time-division UART: 1 ch) 2 ch (UART: 1 ch)
57
2.0 V
Bus
PD780948 60 KB
2 ch
2 ch 1 ch 2 ch
1 ch
1 ch
8 ch
-
- 2 ch
3 ch (UART: 1 ch)
79 69
4.0 V 2.7 V 4.0 V 2.2 V 4.0 V
Yes -
interface PD78098B 40 KB to 60 KB supported PD780816 32 KB to 60 KB Meter control PD780958 48 KB to 60 KB Dashboard PD780852 32 KB to 40 KB control 4 ch 3 ch
12 ch - 1 ch 1 ch 1 ch - 5 ch - -
- - -
2 ch (UART: 1 ch) 2 ch (UART: 1 ch) 3 ch (UART: 1 ch)
46 69 56 59
2 ch 1 ch
- -
PD780828B 32 KB to 60 KB
Note
16-bit timer: 2 channels 10-bit timer: 1 channel
User's Manual U14260EJ3V1UD
25
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.7 Block Diagram
TI000/TO00/P70 TI010/P71
16-bit timer/ event counter 00
Port 0
4
P00 to P03
Port 1 TI001/TO01/P75 TI011/P74 16-bit timer/ event counter 01
8
P10 to P17
Port 2
6
P20 to P25
TI50/TO50/P72
8-bit timer/ event counter 50
Port 3
7
P30 to P36
TI51/TO51/P73
8-bit timer/ event counter 51
Port 4 78K/0 CPU core ROM flash memory
8
P40 to P47
Port 5
8
P50 to P57
Watch timer
Port 6 Watchdog timer Port 7 RxD0/P23 TxD0/P24 ASCK0/P25 RxD2/P35 TxD2/P34 ASCK2/P36 SI3/P34 SO3/P35 SCK3/P36 SI1/P20 SO1/P21 SCK1/P22 SS1/P80 ANI0/P10 to ANI7/P17 ADTRG/P03 AVREF AVSS INTP0/P00 to INTP3/P03 8 A/D converter System control VDD0 VDD1 VSS0 VSS1 IC (VPP) UART0 Internal high-speed RAM 1024 bytes Internal expansion RAM 1024 bytes External access Serial interface SIO3
4
P64 to P67
6
P70 to P75
Port 8 8 8
P80 AD0/P40 to AD7/P47 A8/P50 to A15/P57 RD/P64 WR/P65 WAIT/P66 ASTB/P67 PCL/P74 BUZ/P75
UART2
Serial interface CSI1
Clock/buzzer output control
4
Interrupt control
RESET X1 X2 XT1 XT2
Remarks 1. The internal ROM capacities differ depending on the product. 2. Pin connection in parentheses is intended for the PD78F0078.
26
User's Manual U14260EJ3V1UD
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
1.8 Outline of Functions
Part Number Item Internal memory ROM High-speed RAM Expansion RAM Memory space General-purpose registers Minimum instruction execution time When main system clock selected When subsystem clock selected Instruction set 48 KB (Mask ROM) 1024 bytes 1024 bytes 64 KB 8 bits x 32 registers (8 bits x 8 registers x 4 banks) Minimum instruction execution time selection function * 0.166 s/0.333 s/0.666 s/1.33 s/2.66 s (@ 12 MHz operation, expandedspecification products only) * 0.238 s/0.477 s/0.954 s/1.90 s/3.81 s (@ 8.38 MHz operation) 122 s (@ 32.768 kHz operation) * * * * 16-bit operation Multiply/divide (8 bits x 8 bits, 16 bits / 8 bits) Bit manipulation (set, reset, test, and Boolean operation) BCD adjust, etc. 52 8 40 4 60 KB (Mask ROM) 60 KBNote 1 (Flash memory)
PD780076
PD780078
PD78F0078
I/O ports
Total: * CMOS input: * CMOS I/O: * N-ch open-drain I/O (5 V tolerant): * * * * Timer output 16-bit timer/event counter: 2 8-bit timer/event counter: 2 Watch timer: 1 Watchdog timer: 1 channels channels channel channel
Timer
4 outputs (8-bit PWM output enabled: 2) * 93.7 kHz, 187 kHz, 375 kHz, 750 kHz, 1.5 MHz, 3 MHz, 6 MHz, 12 MHz (12 MHz with main system clock, expanded-specification products only) * 65.5 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.10 MHz, 4.19 MHz, 8.38 MHz (8.38 MHz with main system clock) * 32.768 kHz (32.768 kHz with subsystem clock) * 1.46 kHz, 2.92 kHz, 5.85 kHz, 11.7 kHz (12 MHz with main system clock, expanded-specification products only) * 1.02 kHz, 2.05 kHz, 4.10 kHz, 8.19 kHz (8.38 MHz with main system clock) * 10-bit resolution x 8 channels * Low-voltage operation: AVREF = 2.2 to 5.5 V * 3-wire serial I/O mode: 1 channel * UART mode: 1 channel * 3-wire serial I/O/UART mode selectableNote 2: 1 channel
Clock output
Buzzer output
A/D converter Serial interface
Vectored interrupt source
Maskable Non-maskable Software
Internal: 18, External: 5 Internal: 1 1 VDD = 1.8 to 5.5 V TA = -40 to +85C * 64-pin plastic LQFP (14 x 14) * 64-pin plastic QFP (14 x 14) * 64-pin plastic TQFP (12 x 12)
Power supply voltage Operating ambient temperature Package
Notes 1. The capacity of the internal flash memory can be changed by means of the memory size switching register (IMS). 2. Select either of the functions of these alternate-function pins.
User's Manual U14260EJ3V1UD
27
CHAPTER 1
OUTLINE (PD780078 SUBSERIES)
The following table outlines the timer/event counters (for details, refer to CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01, CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 50, 51, CHAPTER 10 WATCH TIMER, and CHAPTER 11 WATCHDOG TIMER).
16-Bit Timer/Event Counters 00, 01 TM00 Operation mode Function Interval timer External event counter Timer output PPG output PWM output Pulse width measurement Square wave output Interrupt source TM01 8-Bit Timer/Event Counters 50, 51 TM50 TM51 1 channelNote 1 - - - - - - 1 1 channelNote 2 - - - - - - 1Note 3 Watch Timer Watchdog Timer
1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 output 1 output - 2 inputs 1 output 2 1 output 1 output 1 output - 2 inputs - 1 output - 1 output - 1 output - 1 output 1
1 output 1 output 2 1
Notes 1. The watch timer can be used both as a watch timer and an interval timer at the same time. 2. The watchdog timer can be used as either a watchdog timer or interval timer. Select one of the functions. 3. A non-maskable interrupt or maskable interrupt (internal) can be selected for the watchdog timer interrupt (INTWDT).
1.9 Mask Options
The mask ROM versions (PD780076 and 780078) provide pull-up resistor mask options which allow users to specify whether to connect a pull-up resistor to a specific port pin when the user places an order for device production. Using the mask option when pull-up resistors are required reduces the number of components to add to the device, resulting in board space saving. The mask options provided in the PD780078 Subseries are shown in Table 1-2. Table 1-2. Mask Options of Mask ROM Versions
Pin Name P30 to P33 Mask Option Pull-up resistor connection can be specified in 1-bit units.
28
User's Manual U14260EJ3V1UD
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.1 Expanded-Specification Products and Conventional Products
The expanded-specification products and conventional products refer to the following products. Expanded-specification products: Products with a rankNote other than K Mask ROM and flash memory versions for which orders were received on or after February 1, 2002 Conventional products: Products with rankNote K Products other than the above expanded-specification products Note The rank is indicated by the 5th digit from the left in the lot number marked on the package.
Lot number
Year code Week code Rank
Expanded-specification products and conventional products differ in the operating frequency ratings. Table 2-1 shows the differences between these products. Table 2-1. Differences Between Expanded-Specification Products and Conventional Products
Power Supply Voltage (VDD) Guaranteed Operating Speed (Operating Frequency) Conventional Products 4.0 to 5.5 V 3.0 to 5.5 V 2.7 to 5.5 V 1.8 to 5.5 V 8.38 MHz (0.238 s) 5 MHz (0.4 s) 5 MHz (0.4 s) 1.25 MHz (1.6 s) Expanded-Specification Products 8.38 MHz (0.238 s) 8.38 MHz (0.238 s) 5 MHz (0.4 s) 1.25 MHz (1.6 s)
Remark The parenthesized values indicate the minimum instruction execution time.
User's Manual U14260EJ3V1UD
29
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.2 Features
* * *
Minimum instruction execution time changeable from high speed (0.238 s: @ 8.38 MHz operation with main system clock) to ultra-low speed (122 s: @ 32.768 kHz operation with subsystem clock) General-purpose registers: 8 bits x 32 registers (8 bits x 8 registers x 4 banks) Internal memory
Type Part Number Program Memory (ROM) Mask ROM 48 KB 60 KB Flash memory 60 KBNote Data Memory High-Speed RAM 1024 bytes Expansion RAM 1024 bytes
PD780076Y PD780078Y PD78F0078Y
Note The capacity of the internal flash memory can be changed by means of the memory size switching register (IMS).
* *
External memory expansion space: 64 KB (on-chip external device expansion function) Instruction set suited to system control * Bit manipulation possible in all address spaces * Multiply and divide instructions
* *
52 I/O ports: (Four N-ch open-drain ports) Timer: 6 channels * 16-bit timer/event counter: 2 channels * 8-bit timer/event counter: 2 channels * Watch timer: * Watchdog timer: 1 channel 1 channel 4 channels 1 channel 1 channel 1 channel
*
Serial interface: * 3-wire serial mode: * UART mode: * I2C mode:
* 3-wire serial I/O/UART mode selectable: 1 channel
* * * *
10-bit resolution A/D converter: 8 channels Vectored interrupt sources: 26 Two types of on-chip clock oscillators (main system clock and subsystem clock) Power supply voltage: VDD = 1.8 to 5.5 V
30
User's Manual U14260EJ3V1UD
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.3 Applications
Personal computers, air conditioners, dashboards, car audio, etc.
2.4 Ordering Information
Part Number Package 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic TQFP (12 x 12) Internal ROM Mask ROM Mask ROM Mask ROM Mask ROM Mask ROM Mask ROM Flash memory Flash memory Flash memory
PD780076YGC-xxx-8BS PD780076YGC-xxx-AB8 PD780076YGK-xxx-9ET PD780078YGC-xxx-8BS PD780078YGC-xxx-AB8 PD780078YGK-xxx-9ET PD78F0078YGC-8BS PD78F0078YGC-AB8 PD78F0078YGK-9ET
Remark xxx indicates ROM code suffix.
User's Manual U14260EJ3V1UD
31
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.5 Pin Configuration (Top View)
* 64-pin plastic LQFP (14 x 14) * 64-pin plastic QFP (14 x 14) * 64-pin plastic TQFP (12 x 12)
P75/BUZ/TI001/TO01
P74/PCL/TI011
P73/TI51/TO51
P50/A8 P51/A9 P52/A10 P53/A11 P54/A12 P55/A13 P56/A14 P57/A15 VSS0 VDD0 P30 P31 P32/SDA0 P33/SCL0 P34/SI3/TXD2 P35/SO3/RXD2
1 2 3 4 5 6 7 8 9
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34
P72/TI50/TO50
P67/ASTB
P66/WAIT
P47/AD7
P46/AD6
P45/AD5
P44/AD4
P43/AD3
P42/AD2
P41/AD1
P40/AD0
P65/WR
P64/RD
P71/TI010 P70/TI000/TO00 P03/INTP3/ADTRG P02/INTP2 P01/INTP1 P00/INTP0 VSS1 X1 X2 IC (VPP) XT1 XT2 RESET P80/SS1 AVREF P10/ANI0
10 11 12 13 14 15
16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
P36/SCK3/ASCK2
AVSS
P17/ANI7
P16/ANI6
P15/ANI5
P14/ANI4
P13/ANI3
P12/ANI2
P22/SCK1
P23/RxD0
P24/TxD0
Cautions 1. Connect the IC (internally connected) pin directly to VSS0 or VSS1. 2. Connect the AVSS pin to VSS0. Remarks 1. When these devices are used in applications that require the reduction of noise generated from an on-chip microcontroller, the implementation of noise measures is recommended, such as supplying VDD0 and VDD1 independently, connecting VSS0 and VSS1 independently to ground lines, and so on. 2. Pin connection in parentheses is intended for the PD78F0078Y.
32
User's Manual U14260EJ3V1UD
P25/ASCK0
P11/ANI1
P20/SI1
P21/SO1
VDD1
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
A8 to A15: AD0 to AD7: ADTRG: ANI0 to ANI7: ASCK0, ASCK2: ASTB: AVREF: AVSS: BUZ: IC: INTP0 to INTP3: P00 to P03: P10 to P17: P20 to P25: P30 to P36: P40 to P47: P50 to P57: P64 to P67: P70 to P75: P80:
Address bus Address/data bus AD trigger input Analog input Asynchronous serial clock Address strobe Analog reference voltage Analog ground Buzzer clock Internally connected External interrupt input Port 0 Port 1 Port 2 Port 3 Port 4 Port 5 Port 6 Port 7 Port 8
PCL: RD: RESET: RXD0, RXD2: SDA0: SI1, SI3: SO1, SO3: SS1: TI000, TI010, TI001, TI011, TI50, TI51: TO00, TO01, TO50, TO51: TXD0, TXD2: VDD0, VDD1: VPP: VSS0, VSS1: WAIT: WR: X1, X2: XT1, XT2:
Programmable clock Read strobe Reset Receive data Serial data Serial input Serial output Serial interface chip select input Timer input Timer output Transmit data Power supply Programming power supply Ground Wait Write strobe Crystal (main system clock) Crystal (subsystem clock)
SCK1, SCK3, SCL0: Serial clock
User's Manual U14260EJ3V1UD
33
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.6 78K/0 Series Lineup
The 78K/0 Series product lineup is illustrated below. Part numbers in the boxes indicate subseries names.
Products in mass production Products under development
Y subseries products are compatible with I2C bus. Control 100-pin 100-pin 100-pin 100-pin 80-pin 80-pin 80-pin 80-pin 64-pin 64-pin 64-pin 52-pin 52-pin 64-pin 64-pin 42/44-pin
PD78075B PD78078 PD78070A PD780058 PD78058F PD78054 PD780065 PD780078 PD780034A PD780024A PD780034AS
PD780024AS PD78014H
EMI-noise reduced version of the PD78078
PD78078Y PD78070AY PD780018AY PD780058Y PD78058FY PD78054Y
PD78054 with timer and enhanced external interface
ROMless version of the PD78078 PD78078Y with enhanced serial I/O and limited functions
PD78054 with enhanced serial I/O
EMI-noise reduced version of the PD78054
PD78018F with UART and D/A converter, and enhanced I/O PD780024A with expanded RAM PD780034A with timer and enhanced serial I/O PD780078Y PD780034AY PD780024A with enhanced A/D converter PD780024AY PD78018F with enhanced serial I/O 52-pin version of the PD780034A
52-pin version of the PD780024A EMI-noise reduced version of the PD78018F
PD78018F PD78083
Inverter control
PD78018FY
Basic subseries for control On-chip UART, capable of operating at low voltage (1.8 V)
64-pin
PD780988
VFD drive
On-chip inverter control circuit and UART. EMI-noise reduced.
100-pin 80-pin 80-pin 80-pin
PD780208 PD780232 PD78044H PD78044F
LCD drive
PD78044F with enhanced I/O and VFD C/D. Display output total: 53
For panel control. On-chip VFD C/D. Display output total: 53
PD78044F with N-ch open-drain I/O. Display output total: 34
Basic subseries for driving VFD. Display output total: 34
78K/0 Series
100-pin 100-pin 120-pin 120-pin 120-pin 100-pin 100-pin 100-pin
PD780354 PD780344 PD780338 PD780328 PD780318 PD780308 PD78064B PD78064
PD780354Y PD780344Y
PD780344 with enhanced A/D converter PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer. PD780308 with enhanced display function and timer.
Segment signal output: 40 pins max. Segment signal output: 40 pins max. Segment signal output: 32 pins max. Segment signal output: 24 pins max.
PD780308Y PD78064Y
PD78064 with enhanced SIO, and expanded ROM and RAM EMI-noise reduced version of the PD78064
Basic subseries for driving LCDs, on-chip UART
Bus interface supported 100-pin 80-pin 80-pin 80-pin 80-pin 64-pin
PD780948 PD78098B PD780702Y PD780703AY PD780833Y
PD780816
Meter control
On-chip CAN controller
PD78054 with IEBus controller
On-chip IEBus controller On-chip CAN controller On-chip controller compliant with J1850 (Class 2) Specialized for CAN controller function
100-pin 80-pin 80-pin
PD780958 PD780852 PD780828B
For industrial meter control On-chip automobile meter controller/driver For automobile meter driver. On-chip CAN controller
Remark VFD (Vacuum Fluorescent Display) is referred to as FIP (Fluorescent Indicator Panel) in some documents, but the functions of the two are the same.
34
User's Manual U14260EJ3V1UD
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
The major functional differences between the subseries are shown below. * Subseries with the suffix Y
Function Subseries Name Control ROM Capacity 48 KB to 60 KB -- -- 2 ch Timer 8-Bit 10-Bit 8-Bit A/D -- D/A 2 ch 3 ch (UART: 1 ch, I2C: 1 ch) 3 ch (I2C: 1 ch) 88 61 88 1.8 V Serial Interface I/O VDD External
8-Bit 16-Bit Watch WDT A/D 4 ch 1 ch 1 ch 1 ch 8 ch
MIN. Value Expansion 1.8 V 2.7 V Yes
PD78078Y PD78070AY
PD780018AY 48 KB to 60 KB PD780058Y PD78058FY PD78054Y PD780078Y
24 KB to 60 KB
2 ch 3 ch (time-division 68 UART: 1 ch, I2C: 1 ch) 3 ch (UART: 1 ch, I2C: 1 ch) 2 ch -- 8 ch -- 4 ch (UART: 2 ch, I2C: 1 ch) 3 ch (UART: 1 ch, 8 ch -- I2C: 1 ch) 53 66 52 69
48 KB to 60 KB 16 KB to 60 KB 48 KB to 60 KB
2.7 V 2.0 V 1.8 V
PD780034AY 8 KB to 32 KB PD780024AY PD78018FY
LCD drive 8 KB to 60 KB 24 KB to 32 KB 4 ch
1 ch
51
2 ch (I2C: 1 ch) 1 ch 1 ch 1 ch -- 8 ch 8 ch -- -- 4 ch (UART: 1 ch, I2C: 1 ch)
PD780354Y PD780344Y PD780308Y PD78064Y
1.8 V
--
48 KB to 60 KB
2 ch
3 ch (time-division 57 UART: 1 ch, I2C: 1 ch) 2 ch (UART: 1 ch, I2C: 1 ch)
2.0 V
16 KB to 32 KB
Bus
PD780702Y
60 KB
3 ch
2 ch
1 ch
1 ch 16 ch
--
--
4 ch (UART: 1 ch, I2C: 1 ch)
67
3.5 V
--
interface PD780703AY 59.5 KB supported PD780833Y 60 KB
65
4.5 V
Remark The functions of the subseries without the suffix Y and the subseries with the suffix Y are the same, except for the serial interface (if a subseries without the suffix Y is available).
User's Manual U14260EJ3V1UD
35
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.7 Block Diagram
TI000/TO00/P70 TI010/P71
16-bit timer/ event counter 00
Port 0
4
P00 to P03
Port 1 TI001/TO01/P75 TI011/P74 16-bit timer/ event counter 01
8
P10 to P17
Port 2
6
P20 to P25
TI50/TO50/P72
8-bit timer/ event counter 50
Port 3
7
P30 to P36
Port 4 TI51/TO51/P73 8-bit timer/ event counter 51 78K/0 CPU core ROM flash memory
8
P40 to P47
Port 5
8
P50 to P57
Watch timer
Port 6 Watchdog timer Port 7 RxD0/P23 TxD0/P24 ASCK0/P25 RxD2/P35 TxD2/P34 ASCK2/P36 SI3/P34 SO3/P35 SCK3/P36 SI1/P20 SO1/P21 SCK1/P22 SS1/P80 SDA0/P32 SCL0/P33 ANI0/P10 to ANI7/P17 ADTRG/P03 AVREF AVSS INTP0/P00 to INTP3/P03 8 A/D converter System control VDD0 VDD1 VSS0 VSS1 IC (VPP) UART0 Internal high-speed RAM 1024 bytes Internal expansion RAM 1024 bytes External access Serial interface SIO3
4
P64 to P67
6
P70 to P75
Port 8 8 8
P80 AD0/P40 to AD7/P47 A8/P50 to A15/P57 RD/P64 WR/P65 WAIT/P66 ASTB/P67 PCL/P74 BUZ/P75
UART2
Serial interface CSI1
Clock/buzzer output control
I2C bus
4
Interrupt control
RESET X1 X2 XT1 XT2
Remarks 1. The internal ROM capacities differ depending on the product. 2. Pin connection in parentheses is intended for the PD78F0078Y.
36
User's Manual U14260EJ3V1UD
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
2.8 Outline of Functions
Part Number Item Internal memory ROM 48 KB (Mask ROM) 1024 bytes 1024 bytes 64 KB 8 bits x 32 registers (8 bits x 8 registers x 4 banks) Minimum instruction execution time selection function When main system clock selected When subsystem clock selected Instruction set 122 s (@ 32.768 kHz operation) * * * * 16-bit operation Multiply/divide (8 bits x 8 bits, 16 bits / 8 bits) Bit manipulation (set, reset, test, and Boolean operation) BCD adjust, etc. 52 8 40 4 0.238 s/0.477 s/0.954 s/1.90 s/3.81 s (@ 8.38 MHz operation) 60 KB (Mask ROM) 60 KBNote 1 (Flash memory)
PD780076Y
PD780078Y
PD78F0078Y
High-speed RAM Expansion RAM Memory space General-purpose registers Minimum instruction execution time
I/O ports
Total: * CMOS input: * CMOS I/O: * N-ch open-drain I/O (5 V tolerant): * * * * Timer output 16-bit timer/event counter: 2 8-bit timer/event counter: 2 Watch timer: 1 Watchdog timer: 1 channels channels channel channel
Timer
4 outputs (8-bit PWM output enabled: 2) * 65.5 kHz, 131 kHz, 262 kHz, 524 kHz, 1.05 MHz, 2.10 MHz, 4.19 MHz, 8.38 MHz (8.38 MHz with main system clock) * 32.768 kHz (32.768 kHz with subsystem clock) 1.02 kHz, 2.05 kHz, 4.10 kHz, 8.19 kHz (8.38 MHz with main system clock) * 10-bit resolution x 8 channels * Low-voltage operation: AVREF = 2.2 to 5.5 V * * * * 3-wire serial I/O mode: UART mode: 3-wire serial I/O/UART mode selectableNote 2: I2C bus mode: 1 1 1 1 channel channel channel channel
Clock output
Buzzer output A/D converter
Serial interface
Vectored interrupt source
Maskable Non-maskable Software
Internal: 19, External: 5 Internal: 1 1 VDD = 1.8 to 5.5 V TA = -40 to +85C * 64-pin plastic LQFP (14 x 14) * 64-pin plastic QFP (14 x 14) * 64-pin plastic TQFP (12 x 12)
Power supply voltage Operating ambient temperature Package
Notes 1. The capacity of the internal flash memory can be changed by means of the memory size switching register (IMS). 2. Select either of the functions of these alternate-function pins.
User's Manual U14260EJ3V1UD
37
CHAPTER 2
OUTLINE (PD780078Y SUBSERIES)
The following table outlines the timer/event counters (for details, refer to CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01, CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 50, 51, CHAPTER 10 WATCH TIMER, and CHAPTER 11 WATCHDOG TIMER).
16-Bit Timer/Event Counters 00, 01 TM00 Operation mode Function Interval timer External event counter Timer output PPG output PWM output Pulse width measurement Square wave output Interrupt source TM01 8-Bit Timer/Event Counters 50, 51 TM50 TM51 1 channelNote 1 - - - - - - 1 1 channelNote 2 - - - - - - 1Note 3 Watch Timer Watchdog Timer
1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 channel 1 output 1 output - 2 inputs 1 output 2 1 output 1 output 1 output - 2 inputs - 1 output - 1 output - 1 output - 1 output 1
1 output 1 output 2 1
Notes 1. The watch timer can be used both as a watch timer and an interval timer at the same time. 2. The watchdog timer can be used as either a watchdog timer or interval timer. Select one of the functions. 3. A non-maskable interrupt or maskable interrupt (internal) can be selected for the watchdog timer interrupt (INTWDT).
2.9 Mask Options
The mask ROM versions (PD780076Y and 780078Y) provide pull-up resistor mask options which allow users to specify whether to connect a pull-up resistor to a specific port pin when the user places an order for device production. Using this mask option when pull-up resistors are required reduces the number of components to add to the device, resulting in board space saving. The mask options provided in the PD780078Y Subseries are shown in Table 2-2. Table 2-2. Mask Options of Mask ROM Versions
Pin Name P30 and P31 Mask Option Pull-up resistor connection can be specified in 1-bit units.
38
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
3.1 Pin Function List
(1) Port pins (1/2)
Pin Name P00 P01 P02 P03 P10 to P17 Input Port 1 8-bit input-only port. Port 2 6-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Input I/O I/O Function Port 0 4-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. After Reset Input Alternate Function INTP0 INTP1 INTP2 INTP3/ADTRG ANI0 to ANI7
P20 P21 P22 P23 P24 P25 P30 P31 P32 P33 P34 P35 P36 P40 to P47
I/O
Input
SI1 SO1 SCK1 RxD0 TxD0 ASCK0
I/O
Port 3 7-bit I/O port Input/output mode can be specified in 1-bit units.
N-ch open-drain I/O port An on-chip pull-up resistor can be specified by a mask option (mask ROM version only). LEDs can be driven directly. An on-chip pull-up resistor can be used by setting software.
Input
--
SI3/TXD2 SO3/RXD2 SCK3/ASCK2
I/O
Port 4 8-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Interrupt request flag (KRIF) is set to 1 by falling edge detection. Port 5 8-bit I/O port LEDs can be driven directly. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 6 4-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
Input
AD0 to AD7
P50 to P57
I/O
Input
A8 to A15
P64 P65 P66 P67
I/O
Input
RD WR WAIT ASTB
User's Manual U14260EJ3V1UD
39
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
(1) Port pins (2/2)
Alternate Function TI000/TO00 TI010 TI50/TO50 TI51/TO51 TI011/PCL TI001/TO01/BUZ I/O Port 8 1-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Input SS1
Pin Name P70 P71 P72 P73 P74 P75 P80
I/O I/O
Function Port 7 6-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
After Reset Input
(2) Non-port pins (1/2)
Alternate Function P00 P01 P02 P03/ADTRG Input Serial interface serial data input Input P20 P34/TXD2 Output Serial interface serial data output Input P21 P35/RXD2 I/O Serial interface serial clock input/output Input P22 P36/ASCK2 Input Input Serial interface chip select input Asynchronous serial interface serial data input Input Input P80 P23 P35/SO3 Output Asynchronous serial interface serial data output Input P24 P34/SI3 Input Asynchronous serial interface serial clock input Input P25 P36/SCK3 Input External count clock input to 16-bit timer/event counter 00. Capture trigger input to capture registers (CR000, CR010) of 16-bit timer/event counter 00 Capture trigger input to capture register (CR000) of 16-bit timer/event counter 00 External count clock input to 16-bit timer/event counter 01. Capture trigger input to capture registers (CR001, CR011) of 16-bit timer/event counter 01 Input P70/TO00
Pin Name INTP0 INTP1 INTP2 INTP3 SI1 SI3 SO1 SO3 SCK1 SCK3 SS1 RXD0 RXD2 TXD0 TXD2 ASCK0 ASCK2 TI000
I/O Input
Function External interrupt request input with specifiable valid edges (rising edge, falling edge, both rising and falling edges)
After Reset Input
TI010
P71
TI001
P75/TO01/BUZ
40
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
(2) Non-port pins (2/2)
Alternate Function P74/PCL
Pin Name TI011
I/O Input
Function Capture trigger input to capture register (CR001) of 16-bit timer/event counter 01 External count clock input to 8-bit timer/event counter 50 External count clock input to 8-bit timer/event counter 51
After Reset Input
TI50 TI51 TO00 TO01 TO50 TO51 PCL Output Output
P72/TO50 P73/TO51 Input P70/TI000 P75/TI001/BUZ P72/TI50 P73/TI51 Input P74/TI011
16-bit timer/event counter 00 output 16-bit timer/event counter 01 output 8-bit timer/event counter 50 output 8-bit timer/event counter 51 output Clock output (for main system clock and subsystem clock trimming) Buzzer output Lower address/data bus when expanding external memory Higher address bus when expanding external memory Strobe signal output for read operation from external memory Strobe signal output for write operation from external memory
BUZ AD0 to AD7 A8 to A15 RD WR WAIT ASTB
Output I/O Output Output
Input Input Input Input
P75/TI001/TO01 P40 to P47 P50 to P57 P64 P65
Input Output
Wait insertion when accessing external memory Strobe output externally latching address information output to ports 4 and 5 to access external memory A/D converter analog input A/D converter trigger signal input A/D converter reference voltage input and analog power supply A/D converter ground potential. Connect to VSS0 or VSS1. System reset input Resonator connection for main system clock
Input Input
P66 P67
ANI0 to ANI7 ADTRG AVREF AVSS RESET X1 X2 XT1 XT2 VDD0 VDD1 VSS0 VSS1 IC VPP
Input Input Input -- Input Input -- Input -- -- -- -- -- -- --
Input Input -- -- Input -- --
P10 to P17 P03/INTP3 -- -- -- -- -- -- -- -- -- -- -- -- --
Resonator connection for subsystem clock
-- --
Positive power supply for ports Positive power supply (other than ports) Ground potential for ports Ground potential (other than ports) Internally connected. Connect directly to VSS0 or VSS1. Flash memory programming mode setting. High-voltage application for program write/verify
-- -- -- -- -- --
User's Manual U14260EJ3V1UD
41
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
3.2 Description of Pin Functions
3.2.1 P00 to P03 (Port 0) P00 to P03 function as a 4-bit I/O port. Besides serving as an I/O port, they also function as external interrupt inputs and an A/D converter external trigger input. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 4-bit I/O port. P00 to P03 can be specified as input or output in 1-bit units using port mode register 0 (PM0). On-chip pull-up resistors can be connected by setting pull-up resistor option register 0 (PU0). (2) Control mode In this mode, these pins function as external interrupt request inputs and an A/D converter external trigger input. (a) INTP0 to INTP3 INTP0 to INTP3 are external interrupt request input pins for which the valid edge can be specified (rising edge, falling edge, or both rising and falling edges). (b) ADTRG A/D converter external trigger input pin. Caution When P03 is used as an A/D converter external trigger input, specify the valid edge by using bits 1 and 2 (EGA00, EGA01) of the A/D converter mode register (ADM0) and set the interrupt mask flag (PMK3) to 1. 3.2.2 P10 to P17 (Port 1) P10 to P17 function as an 8-bit input-only port. Besides serving as an input port, they also function as A/D converter analog inputs. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as an 8-bit input-only port. (2) Control mode These pins function as A/D converter analog input pins (ANI0 to ANI7). When using these pins as analog input pins, see (4) ANI0/P10 to ANI7/P17 in 13.6 Cautions for A/D Converter. 3.2.3 P20 to P25 (Port 2) P20 to P25 function as a 6-bit I/O port. Besides serving as an I/O port, they function as data I/O and clock I/O for serial interfaces CSI1 and UART0. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 6-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 2 (PM2). On-chip pull-up resistors can be connected by setting pull-up resistor option register 2 (PU2).
42
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
(2) Control mode These pins function as data I/O and clock I/O for serial interfaces CSI1 and UART0. (a) SI1 Serial data input pin for serial interface CSI1. (b) SO1 Serial data output pin for serial interface CSI1. (c) SCK1 Serial clock I/O pin for serial interface CSI1. (d) RXD0 Serial data input pin for serial interface UART0. (e) TXD0 Serial data output pin for serial interface UART0. (f) ASCK0 Serial clock input pin for serial interface UART0. 3.2.4 P30 to P36 (Port 3) P30 to P36 function as a 7-bit I/O port. Besides serving as an I/O port, they also function as data I/O and clock I/O for serial interfaces SIO3 and UART2. P30 to P33 can drive LEDs directly. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 7-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 3 (PM3). P30 to P33 are N-ch open drain I/O pins. On-chip pull-up resistors can be connected via a mask option (mask ROM version only). On-chip pull-up resistors can be connected to P34 to P36 by setting pullup resistor option register 3 (PU3). (2) Control mode These pins function as data I/O and clock I/O for serial interfaces SIO3 and UART2. (a) SI3 Serial data input pin for serial interface SIO3. (b) SO3 Serial data output pin for serial interface SIO3. (c) SCK3 Serial clock I/O pin for serial interface SIO3. (d) RXD2 Serial data input pin for serial interface UART2.
User's Manual U14260EJ3V1UD
43
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
(e) TXD2 Serial data output pin for serial interface UART2. (f) ASCK2 Serial clock input pin for serial interface UART2. 3.2.5 P40 to P47 (Port 4) P40 to P47 function as an 8-bit I/O port. Besides serving as an I/O port, they also function as an address/data bus. The interrupt request flag (KRIF) can be set to 1 by detecting a falling edge. The following operating modes can be specified. Caution When using the falling edge detection interrupt (INTKR), be sure to set the memory expansion mode register (MEM) to 01H. (1) Port mode These pins function as an 8-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 4 (PM4). On-chip pull-up resistors can be connected by setting pull-up resistor option register 4 (PU4). (2) Control mode These ports function as the lower address/data bus pins (AD0 to AD7) in external memory expansion mode. 3.2.6 P50 to P57 (Port 5) P50 to P57 function as an 8-bit I/O port. Besides serving as an I/O port, they also function as an address bus. Port 5 can drive LEDs directly. The following operating modes can be specified. (1) Port mode These pins function as an 8-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 5 (PM5). On-chip pull-up resistors can be connected by setting pull-up resistor option register 5 (PU5). (2) Control mode These ports function as the higher address bus pins (A8 to A15) in external memory expansion mode. 3.2.7 P64 to P67 (Port 6) P64 to P67 function as a 4-bit I/O port. Besides serving as an I/O port, they are also used for control in external memory expansion mode. The following operating modes can be specified. (1) Port mode These pins function as a 4-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 6 (PM6). On-chip pull-up resistors can be connected by setting pull-up resistor option register 6 (PU6). (2) Control mode These pins function as control signal output pins (RD, WR, WAIT, ASTB) in external memory expansion mode. Caution When external wait is not used in external memory expansion mode, P66 can be used as an I/O port.
44
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
3.2.8 P70 to P75 (Port 7) P70 to P75 function as a 6-bit I/O port. Besides serving as an I/O port, they also function as timer I/O, clock output, and buzzer output. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 6-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 7 (PM7). On-chip pull-up resistors can be connected by setting pull-up resistor option register 7 (PU7). P70 and P71 are also capture trigger signal input pins of 16-bit timer/event counters 00 and 01 with a valid edge input. (2) Control mode These pins function as timer I/O, clock output, and buzzer output. (a) TI000 External count clock input pin to 16-bit timer/event counter 00 and capture trigger signal input pin to the 16bit timer/event counter 00 capture registers (CR000, CR010). (b) TI001 External count clock input pin to 16-bit timer/event counter 01 and capture trigger signal input pin to the 16bit timer/event counter 01 capture registers (CR001, CR011). (c) TI010 Capture trigger signal input pin to the 16-bit timer/event counter 00 capture register (CR000). (d) TI011 Capture trigger signal input pin to the 16-bit timer/event counter 01 capture register (CR001). (e) TI50 and TI51 External count clock input pins to 8-bit timer/event counters 50 and 51. (f) TO00, TO01, TO50, and TO51 Timer output pins. (g) PCL Clock output pin. (h) BUZ Buzzer output pin.
User's Manual U14260EJ3V1UD
45
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
3.2.9 P80 (Port 8) P80 is a 1-bit I/O port. Besides serving as an I/O port, it also functions as the chip select input of serial interface CSI1. The following operating modes can be specified in 1-bit units. (1) Port mode This pin functions as a 1-bit I/O port. It can be specified as input or output in 1-bit units using port mode register 8 (PM8). An on-chip pull-up resistor can be connected by setting pull-up resistor option register 8 (PU8). (2) Control mode This pin functions as the chip select input pin (SS1) of serial interface CSI1. 3.2.10 AVREF This is the A/D converter reference voltage input pin. This pin is also used for the analog power supply. When using the A/D converter, supply power to this pin. When the A/D converter is not used, connect this pin directly to VSS0 or VSS1. 3.2.11 AVSS This is the ground potential pin of the A/D converter. Use the same potential as that of the VSS0 pin or VSS1 pin even when not using the A/D converter. 3.2.12 RESET This is an active-low system reset input pin. 3.2.13 X1 and X2 Resonator connection pins for main system clock. For an external clock supply, input the clock signal to X1 and its inverted signal to X2. 3.2.14 XT1 and XT2 Resonator connection pins for subsystem clock. For an external clock supply, input the clock signal to XT1 and its inverted signal to XT2. 3.2.15 VDD0 and VDD1 VDD0 is the positive power supply pin for the ports. VDD1 is the positive power supply pin for other than the ports. 3.2.16 VSS0 and VSS1 VSS0 is the ground potential pin for the ports. VSS1 is the ground potential pin for other than the ports. 3.2.17 VPP (flash memory versions only) High-voltage application pin for flash memory programming mode setting and program write/verify. Handle in either of the following ways. * Independently connect a 10 k pull-down resistor. * Set the jumper on the board so that this pin is connected directly to the dedicated flash programmer in programming mode and directly to VSS0 or VSS1 in normal operation mode.
46
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
When there is a potential difference between the VPP pin and VSS0 pin or VSS1 pin because the wiring between the two pins is too long or external noise is input to the VPP pin, the user program may not operate normally. 3.2.18 IC (mask ROM version only) The IC (internally connected) pin is provided to set the test mode to check the PD780078 Subseries at delivery. Connect it directly to VSS0 or VSS1 with the shortest possible wiring in the normal operating mode. When there is a potential difference between the IC pin and VSS0 pin or VSS1 pin because the wiring between the two pins is too long or external noise is input to the IC pin, the user program may not operate normally. * Connect IC pin to VSS0 or VSS1 pin directly.
VSS0 or VSS1 IC
As short as possible
User's Manual U14260EJ3V1UD
47
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
3.3 Pin I/O Circuits and Recommended Connection of Unused Pins
Table 3-1 shows the types of pin I/O circuits and the recommended connections of unused pins. Refer to Figure 3-1 for the configuration of the I/O circuit of each type. Table 3-1. Pin I/O Circuit Types (1/2)
Pin Name P00/INTP0 to P02/INTP2 P03/INTP3/ADTRG P10/ANI0 to P17/ANI7 P20/SI1 P21/SO1 P22/SCK1 P23/RxD0 P24/TxD0 P25/ASCK0 P30, P31 (for mask ROM version) P30, P31 (for flash memory version) P32, P33 (for mask ROM version) P32, P33 (for flash memory version) P34/SI3/TXD2 P35/SO3/RXD2 P36/SCK3/ASCK2 P40/AD0 to P47/AD7 5-H 5-H 8-C 13-Q Input: Connect directly to VSS0 or VSS1. Output: Leave open at low-level output with the output latch of the port set to 0. 25 8-C 5-H 8-C Input I/O I/O Circuit Type 8-C I/O I/O Input: Recommended Connection of Unused Pins Independently connect to VSS0 or VSS1 via a resistor.
Output: Leave open. Connect directly to VDD0, VDD1, VSS0, or VSS1. Input: Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor. Output: Leave open.
13-P
13-S
13-R
8-C
Input:
Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor.
Output: Leave open. Input: Independently connect to VDD0 or VDD1 via a resistor. Output: Leave open.
48
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
Table 3-1. Pin I/O Circuit Types (2/2)
Pin Name P50/A8 to P57/A15 P64/RD P65/WR P66/WAIT P67/ASTB P70/TI000/TO00 P71/TI010 P72/TI50/TO50 P73/TI51/TO51 P74/TI011/PCL P75/TI001/TO01/BUZ P80/SS1 Input: Output: 2 16 -- -- Input Connect to VSS0 or VSS1 via a resistor. Leave open. -- Connect directly to VDD0 or VDD1. Leave open. Connect directly to VSS0 or VSS1. 8-C Output: I/O Circuit Type 5-H I/O I/O Input: Recommended Connection of Unused Pins Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor. Leave open.
RESET XT1 XT2 AVREF AVSS IC (for mask ROM version) VPP (for flash memory version)
Independently connect a 10 k pull-down resistor or connect directly to VSS0 or VSS1.
User's Manual U14260EJ3V1UD
49
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
Figure 3-1. Pin I/O Circuits (1/2)
Type 2 Type 13-P IN/OUT Data Output disable IN N-ch VSS0
Schmitt-triggered input with hysteresis characteristics
Input enable
Type 5-H
VDD0
Type 13-Q
Mask option
VDD0
Pull-up enable Data
P-ch VDD0 P-ch IN/OUT Data Output disable N-ch VSS0
IN/OUT
Output disable Input enable Type 8-C
N-ch VSS0 Input enable
Type 13-R VDD0 IN/OUT
Pull-up enable Data
P-ch VDD0 P-ch IN/OUT
Data Output disable
N-ch
VSS0
Output disable
N-ch VSS0
50
User's Manual U14260EJ3V1UD
CHAPTER 3
PIN FUNCTIONS (PD780078 SUBSERIES)
Figure 3-1. Pin I/O Circuits (2/2)
Type 13-S
Mask option
VDD0 IN/OUT
Type 25
Data Output disable
P-ch N-ch Comparator
+ --
VSS0
N-ch VSS0 VREF (threshold voltage)
IN
Input enable
Type 16
Feedback cut-off P-ch
XT1
XT2
User's Manual U14260EJ3V1UD
51
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
4.1 Pin Function List
(1) Port pins (1/2)
Pin Name P00 P01 P02 P03 P10 to P17 Input Port 1 8-bit input-only port. Port 2 6-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Input I/O I/O Function Port 0 4-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. After Reset Input Alternate Function INTP0 INTP1 INTP2 INTP3/ADTRG ANI0 to ANI7
P20 P21 P22 P23 P24 P25 P30 P31 P32 P33 P34 P35 P36 P40 to P47
I/O
Input
SI1 SO1 SCK1 RxD0 TxD0 ASCK0
I/O
Port 3 7-bit I/O port Input/output mode can be specified in 1-bit units.
N-ch open-drain I/O port On-chip pull-up resistor can be specified by mask option (P30 and P31 are mask ROM version only). LEDs can be driven directly. An on-chip pull-up resistor can be used by setting software.
Input
--
SDA0 SCL0 SI3/TXD2 SO3/RXD2 SCK3/ASCK2
I/O
Port 4 8-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Interrupt request flag (KRIF) is set to 1 by falling edge detection. Port 5 8-bit I/O port LEDs can be driven directly. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 6 4-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
Input
AD0 to AD7
P50 to P57
I/O
Input
A8 to A15
P64 P65 P66 P67
I/O
Input
RD WR WAIT ASTB
52
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
(1) Port pins (2/2)
Alternate Function TI000/TO00 TI010 TI50/TO50 TI51/TO51 TI011/PCL TI001/TO01/BUZ I/O Port 8 1-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Input SS1
Pin Name P70 P71 P72 P73 P74 P75 P80
I/O I/O
Function Port 7 6-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
After Reset Input
(2) Non-port pins (1/2)
Alternate Function P00 P01 P02 P03/ADTRG Input Output I/O I/O Serial interface serial data input Serial interface serial data output Serial interface serial data input/output Serial interface serial clock input/output Input Input Input Input P20 P21 P32 P22 P30/ASCK2 P33 Input Input Serial interface chip select input Asynchronous serial interface serial data input Input Input P80 P23 P35/SO3 Output Asynchronous serial interface serial data output Input P24 P34/SI3 Input Asynchronous serial interface serial clock input Input P25 P36/SCK3 Input External count clock input to 16-bit timer/event counter 00. Capture trigger input to capture registers (CR000, CR010) of 16-bit timer/event counter 00 Capture trigger input to capture register (CR000) of 16-bit timer/event counter 00 External count clock input to 16-bit timer/event counter 01. Capture trigger input to capture registers (CR001, CR011) of 16-bit timer/event counter 01 Input P70/TO00
Pin Name INTP0 INTP1 INTP2 INTP3 SI1 SO1 SDA0 SCK1 SCK3 SCL0 SS1 RXD0 RXD2 TXD0 TXD2 ASCK0 ASCK2 TI000
I/O Input
Function External interrupt request input with specifiable valid edges (rising edge, falling edge, both rising and falling edges)
After Reset Input
TI010
P71
TI001
P75/TO01/BUZ
User's Manual U14260EJ3V1UD
53
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
(2) Non-port pins (2/2)
Alternate Function P74/PCL
Pin Name TI011
I/O Input
Function Capture trigger input to capture register (CR001) of 16-bit timer/event counter 01 External count clock input to 8-bit timer/event counter 50 External count clock input to 8-bit timer/event counter 51
After Reset Input
TI50 TI51 TO00 TO01 TO50 TO51 PCL Output Output
P72/TO50 P73/TO51 Input P70/TI000 P75/TI001/BUZ P72/TI50 P73/TI51 Input P74/TI011
16-bit timer/event counter 00 output 16-bit timer/event counter 01 output 8-bit timer/event counter 50 output 8-bit timer/event counter 51 output Clock output (for main system clock and subsystem clock trimming)
BUZ AD0 to AD7 A8 to A15 RD WR WAIT ASTB
Output I/O Output Output
Buzzer output Lower address/data bus when expanding external memory Higher address bus when expanding external memory Strobe signal output for read operation from external memory Strobe signal output for write operation from external memory
Input Input Input Input
P75/TI001/TO01 P40 to P47 P50 to P57 P64 P65
Input Output
Wait insertion when accessing external memory Strobe output externally latching address information output to ports 4 and 5 to access external memory A/D converter analog input A/D converter trigger signal input A/D converter reference voltage input and analog power supply A/D converter ground potential. Connect to VSS0 or VSS1. System reset input Resonator connection for main system clock
Input Input
P66 P67
ANI0 to ANI7 ADTRG AVREF AVSS RESET X1 X2 XT1 XT2 VDD0 VDD1 VSS0 VSS1 IC VPP
Input Input Input -- Input Input -- Input -- -- -- -- -- -- --
Input Input -- -- Input -- --
P10 to P17 P03/INTP3 -- -- -- -- -- -- -- -- -- -- -- -- --
Resonator connection for subsystem clock
-- --
Positive power supply for ports Positive power supply (other than ports) Ground potential for ports Ground potential (other than ports) Internally connected. Connect directly to VSS0 or VSS1. Flash memory programming mode setting. High-voltage application for program write/verify
-- -- -- -- -- --
54
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
4.2 Description of Pin Functions
4.2.1 P00 to P03 (Port 0) P00 to P03 function as a 4-bit I/O port. Besides serving as an I/O port, they also function as external interrupt inputs and an A/D converter external trigger input. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 4-bit I/O port. P00 to P03 can be specified as input or output in 1-bit units using port mode register 0 (PM0). On-chip pull-up resistors can be connected by setting pull-up resistor option register 0 (PU0). (2) Control mode In this mode, these pins function as external interrupt request inputs and an A/D converter external trigger input. (a) INTP0 to INTP3 INTP0 to INTP3 are external interrupt request input pins for which the valid edge can be specified (rising edge, falling edge, or both rising and falling edges). (b) ADTRG A/D converter external trigger input pin. Caution When P03 is used as an A/D converter external trigger input, specify the valid edge by using bits 1 and 2 (EGA00, EGA01) of the A/D converter mode register (ADM0) and set the interrupt mask flag (PMK3) to 1. 4.2.2 P10 to P17 (Port 1) P10 to P17 function as an 8-bit input-only port. Besides serving as an input port, they also function as A/D converter analog inputs. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as an 8-bit input-only port. (2) Control mode These pins function as A/D converter analog input pins (ANI0 to ANI7). When using these pins as analog input pins, see (4) ANI0/P10 to ANI7/P17 in 13.6 Cautions for A/D Converter. 4.2.3 P20 to P25 (Port 2) P20 to P25 function as a 6-bit I/O port. Besides serving as an I/O port, they function as data I/O and clock I/O for serial interfaces CSI1 and UART0. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 6-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 2 (PM2). On-chip pull-up resistors can be connected by setting pull-up resistor option register 2 (PU2).
User's Manual U14260EJ3V1UD
55
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
(2) Control mode These pins function as data I/O and clock I/O for serial interfaces CSI1 and UART0. (a) SI1 Serial data input pin for serial interface CSI1. (b) SO1 Serial data output pin for serial interface CSI1. (c) SCK1 Serial clock I/O pin for serial interface CSI1. (d) RXD0 Serial data input pin for serial interface UART0. (e) TXD0 Serial data output pin for serial interface UART0. (f) ASCK0 Serial clock input pin for serial interface UART0. 4.2.4 P30 to P36 (Port 3) P30 to P36 function as a 7-bit I/O port. Besides serving as an I/O port, they also function as data I/O and clock I/O for serial interfaces SIO3 and UART2. P30 to P33 can drive LEDs directly. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 7-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 3 (PM3). P30 to P33 are N-ch open drain I/O pins. Mask ROM version can contain pull-up resistors in P30 and P31 with the mask option. On-chip pull-up resistors can be connected to P34 to P36 by setting pullup resistor option register 3 (PU3). (2) Control mode These pins function as data I/O and clock I/O for serial interfaces SIO3 and UART2. (a) SI3 Serial data input pin for serial interface SIO3. (b) SO3 Serial data output pin for serial interface SIO3. (c) SCK3 Serial clock I/O pin for serial interface SIO3. (d) RXD2 Serial data input pin for serial interface UART2.
56
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
(e) TXD2 Serial data output pin for serial interface UART2. (f) ASCK2 Serial clock input pin for serial interface UART2. 4.2.5 P40 to P47 (Port 4) P40 to P47 function as an 8-bit I/O port. Besides serving as an I/O port, they also function as an address/data bus. The interrupt request flag (KRIF) can be set to 1 by detecting a falling edge. The following operating modes can be specified. Caution When using the falling edge detection interrupt (INTKR), be sure to set the memory expansion mode register (MEM) to 01H. (1) Port mode These pins function as an 8-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 4 (PM4). On-chip pull-up resistors can be connected by setting pull-up resistor option register 4 (PU4). (2) Control mode These ports function as the lower address/data bus pins (AD0 to AD7) in external memory expansion mode. 4.2.6 P50 to P57 (Port 5) P50 to P57 function as an 8-bit I/O port. Besides serving as an I/O port, they also function as an address bus. Port 5 can drive LEDs directly. The following operating modes can be specified. (1) Port mode These pins function as an 8-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 5 (PM5). On-chip pull-up resistors can be connected by setting pull-up resistor option register 5 (PU5). (2) Control mode These ports function as the higher address bus pins (A8 to A15) in external memory expansion mode. 4.2.7 P64 to P67 (Port 6) P64 to P67 function as a 4-bit I/O port. Besides serving as an I/O port, they are also used for control in external memory expansion mode. The following operating modes can be specified. (1) Port mode These pins function as a 4-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 6 (PM6). On-chip pull-up resistors can be connected by setting pull-up resistor option register 6 (PU6). (2) Control mode These pins function as control signal output pins (RD, WR, WAIT, ASTB) in external memory expansion mode. Caution When external wait is not used in external memory expansion mode, P66 can be used as an I/O port.
User's Manual U14260EJ3V1UD
57
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
4.2.8 P70 to P75 (Port 7) P70 to P75 function as a 6-bit I/O port. Besides serving as an I/O port, they also function as timer I/O, clock output, and buzzer output. The following operating modes can be specified in 1-bit units. (1) Port mode These pins function as a 6-bit I/O port. They can be specified as input or output in 1-bit units using port mode register 7 (PM7). On-chip pull-up resistors can be connected by setting pull-up resistor option register 7 (PU7). P70 and P71 are also capture trigger signal input pins of 16-bit timer/event counters 00 and 01 with a valid edge input. (2) Control mode These pins function as timer I/O, clock output, and buzzer output. (a) TI000 External count clock input pin to 16-bit timer/event counter 00 and capture trigger signal input pin to the 16bit timer/event counter 00 capture registers (CR000, CR010). (b) TI001 External count clock input pin to 16-bit timer/event counter 01 and capture trigger signal input pin to the 16bit timer/event counter 01 capture registers (CR001, CR011). (c) TI010 Capture trigger signal input pin to the 16-bit timer/event counter 00 capture register (CR000). (d) TI011 Capture trigger signal input pin to the 16-bit timer/event counter 01 capture register (CR001). (e) TI50 and TI51 External count clock input pins to 8-bit timer/event counters 50 and 51. (f) TO00, TO01, TO50, and TO51 Timer output pins. (g) PCL Clock output pin. (h) BUZ Buzzer output pin.
58
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
4.2.9 P80 (Port 8) P80 is a 1-bit I/O port. Besides serving as an I/O port, it also functions as the chip select input of serial interface CSI1. The following operating modes can be specified in 1-bit units. (1) Port mode This pin functions as a 1-bit I/O port. It can be specified as input or output in 1-bit units using port mode register 8 (PM8). An on-chip pull-up resistor can be connected by setting pull-up resistor option register 8 (PU8). (2) Control mode This pin functions as the chip select input pin (SS1) of serial interface CSI1. 4.2.10 AVREF This is the A/D converter reference voltage input pin. This pin is also used for the analog power supply. When using the A/D converter, supply power to this pin. When the A/D converter is not used, connect this pin directly to VSS0 or VSS1. 4.2.11 AVSS This is the ground potential pin of the A/D converter. Use the same potential as that of the VSS0 pin or VSS1 pin even when not using the A/D converter. 4.2.12 RESET This is an active-low system reset input pin. 4.2.13 X1 and X2 Resonator connection pins for main system clock. For an external clock supply, input the clock signal to X1 and its inverted signal to X2. 4.2.14 XT1 and XT2 Resonator connection pins for subsystem clock. For an external clock supply, input the clock signal to XT1 and its inverted signal to XT2. 4.2.15 VDD0 and VDD1 VDD0 is the positive power supply pin for the ports. VDD1 is the positive power supply pin for other than the ports. 4.2.16 VSS0 and VSS1 VSS0 is the ground potential pin for the ports. VSS1 is the ground potential pin for other than the ports. 4.2.17 VPP (flash memory versions only) High-voltage application pin for flash memory programming mode setting and program write/verify. Handle in either of the following ways. * Independently connect a 10 k pull-down resistor. * Set the jumper on the board so that this pin is connected directly to the dedicated flash programmer in programming mode and directly to VSS0 or VSS1 in normal operation mode.
User's Manual U14260EJ3V1UD
59
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
When there is a potential difference between the VPP pin and VSS0 pin or VSS1 pin because the wiring between the two pins is too long or external noise is input to the VPP pin, the user program may not operate normally. 4.2.18 IC (mask ROM version only) The IC (internally connected) pin is provided to set the test mode to check the PD780078Y Subseries at delivery. Connect it directly to VSS0 or VSS1 with the shortest possible wiring in the normal operating mode. When there is a potential difference between the IC pin and VSS0 pin or VSS1 pin because the wiring between the two pins is too long or external noise is input to the IC pin, the user program may not operate normally. * Connect IC pin to VSS0 or VSS1 pin directly.
VSS0 or VSS1 IC
As short as possible
60
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
4.3 Pin I/O Circuits and Recommended Connection of Unused Pins
Table 4-1 shows the types of pin I/O circuits and the recommended connections of unused pins. Refer to Figure 4-1 for the configuration of the I/O circuit of each type. Table 4-1. Pin I/O Circuit Types (1/2)
Pin Name P00/INTP0 to P02/INTP2 P03/INTP3/ADTRG P10/ANI0 to P17/ANI7 P20/SI1 P21/SO1 P22/SCK1 P23/RxD0 P24/TxD0 P25/ASCK0 P30, P31 (for mask ROM version) P30, P31 (for flash memory version) P32/SDA0 P33/SCL0 P34/SI3/TXD2 P35/SO3/RXD2 P36/SCK3/ASCK2 P40/AD0 to P47/AD7 5-H 8-C Input: Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor. Output: Leave open. Input: Independently connect to VDD0 or VDD1 via a resistor. Output: Leave open. 5-H 8-C 13-Q Input: Connect directly to VSS0 or VSS1. Output: Leave open at low-level output with the output latch of the port set to 0. 25 8-C 5-H 8-C Input I/O I/O Circuit Type 8-C I/O I/O Input: Recommended Connection of Unused Pins Independently connect to VSS0 or VSS1 via a resistor.
Output: Leave open. Connect directly to VDD0, VDD1, VSS0, or VSS1. Input: Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor. Output: Leave open.
13-P
13-R
User's Manual U14260EJ3V1UD
61
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
Table 4-1. Pin I/O Circuit Types (2/2)
Pin Name P50/A8 to P57/A15 P64/RD P65/WR P66/WAIT P67/ASTB P70/TI000/TO00 P71/TI010 P72/TI50/TO50 P73/TI51/TO51 P74/TI011/PCL P75/TI001/TO01/BUZ P80/SS1 Input: Connect to VSS0 or VSS1 via a resistor. Output: Leave open. 2 16 -- -- Input -- Connect directly to VDD0 or VDD1. Leave open. Connect directly to VSS0 or VSS1. 8-C I/O Circuit Type 5-H I/O I/O Input: Recommended Connection of Unused Pins Independently connect to VDD0, VDD1, VSS0, or VSS1 via a resistor. Output: Leave open.
RESET XT1 XT2 AVREF AVSS IC (for mask ROM version) VPP (for flash memory version)
Independently connect a 10 k pull-down resistor or connect directly to VSS0 or VSS1.
62
User's Manual U14260EJ3V1UD
CHAPTER 4
PIN FUNCTIONS (PD780078Y SUBSERIES)
Figure 4-1. Pin I/O Circuits
Type 2
Type 13-Q
Mask option
VDD0
IN/OUT Data Output disable IN N-ch VSS0
Schmitt-triggered input with hysteresis characteristics
Input enable
Type 5-H
VDD0
Type 13-R
Pull-up enable Data
IN/OUT P-ch VDD0 P-ch VSS0 IN/OUT Data Output disable N-ch
Output disable Input enable Type 8-C
N-ch VSS0
Type 16 VDD0 Feedback cut-off P-ch VDD0 P-ch IN/OUT P-ch
Pull-up enable Data
Output disable
N-ch VSS0 XT1 XT2
Type 13-P IN/OUT Data Output disable N-ch VSS0
Type 25
P-ch Comparator
+ --
N-ch VSS0 VREF (threshold voltage)
IN
Input enable Input enable
User's Manual U14260EJ3V1UD
63
CHAPTER 5
CPU ARCHITECTURE
5.1 Memory Spaces
Products in the PD780078, 780078Y Subseries can each access a 64 KB memory space. Figures 5-1 to 5-3 show the memory maps. Caution The initial value of the memory size switching register (IMS) and internal expansion RAM size switching register (IXS) of all products (PD780078, 780078Y Subseries) is fixed (IMS = CFH, IXS = 0CH). Therefore, set the value corresponding to each product as indicated below.
Value of IMS Value of IXS 0AH
PD780076, 780076Y PD780078, 780078Y PD78F0078, 78F0078Y
CCH CFH Value corresponding to mask ROM version
Figure 5-1. Memory Map (PD780076, 780076Y)
FFFFH Special function registers (SFRs) 256 x 8 bits FF00H FEFFH FEE0H FEDFH General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits FB00H FAFFH Reserved F800H F7FFH Data memory space F400H F3FFH External memory 13312 x 8 bits C000H BFFFH Internal expansion RAM 1024 x 8 bits BFFFH Program area 1000H 0FFFH CALLF entry area 0800H 07FFH Program area ROM/RAM space in which instructions can be fetched Internal ROM 49152 x 8 bits 0040H 003FH Vector table area 0000H 0000H 0080H 007FH CALLT table area
64
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
Figure 5-2. Memory Map (PD780078, 780078Y)
FFFFH Special function registers (SFRs) 256 x 8 bits FF00H FEFFH FEE0H FEDFH General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits FB00H FAFFH Reserved F800H F7FFH Data memory space F400H F3FFH External memory 1024 x 8 bits F000H EFFFH Internal expansion RAM 1024 x 8 bits EFFFH Program area 1000H 0FFFH CALLF entry area 0800H 07FFH Program area ROM/RAM space in which instructions can be fetched Internal ROM 61440 x 8 bits 0040H 003FH Vector table area 0000H 0000H 0080H 007FH CALLT table area
User's Manual U14260EJ3V1UD
65
CHAPTER 5
CPU ARCHITECTURE
Figure 5-3. Memory Map (PD78F0078, 78F0078Y)
FFFFH Special function registers (SFRs) 256 x 8 bits FF00H FEFFH FEE0H FEDFH General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits FB00H FAFFH Reserved F800H F7FFH Data memory space F400H F3FFH External memory 1024 x 8 bits F000H EFFFH Internal expansion RAM 1024 x 8 bits EFFFH Program area 1000H 0FFFH CALLF entry area 0800H 07FFH Program area ROM/RAM space in which instructions can be fetched Flash memory 61440 x 8 bits 0040H 003FH Vector table area 0000H 0000H 0080H 007FH CALLT table area
66
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.1.1 Internal program memory space The internal program memory space contains the program and table data. Normally, it is addressed with the program counter (PC). The PD780078, 780078Y Subseries incorporate internal ROM (mask ROM or flash memory), as listed below. Table 5-1. Internal Memory Capacity
Part Number Type Mask ROM Capacity 49152 x 8 bits (0000H to BFFFH) 61440 x 8 bits (0000H to EFFFH) Flash memory 61440 x 8 bits (0000H to EFFFH)
PD780076, 780076Y PD780078, 780078Y PD78F0078, 78F0078Y
The internal program memory space is divided into the following three areas. (1) Vector table area The 64-byte area 0000H to 003FH is reserved as a vector table area. The program start addresses for branch upon RESET input or interrupt request generation are stored in the vector table area. Of the 16-bit address, the lower 8 bits are stored at even addresses and the higher 8 bits are stored at odd addresses. Table 5-2. Vector Table
Vector Table Address 0000H 0004H 0006H 0008H 000AH 000CH 000EH 0010H 0012H 0014H 0016H 0018H 001AH Interrupt Source RESET input INTWDT INTP0 INTP1 INTP2 INTP3 INTSER0 INTSR0 INTST0 INTCSI1 INTCSI3 INTIIC0Note INTWTI Vector Table Address 001CH 001EH 0020H 0022H 0024H 0026H 0028H 002AH 002CH 002EH 0030H 0032H 003EH Interrupt Source INTTM000 INTTM010 INTTM50 INTTM51 INTAD0 INTWT INTKR INTSER2 INTSR2 INTST2 INTTM001 INTTM011 BRK
Note
PD780078Y Subseries only
(2) CALLT instruction table area The 64-byte area 0040H to 007FH can store the subroutine entry address of a 1-byte call instruction (CALLT). (3) CALLF instruction entry area The area 0800H to 0FFFH can perform a direct subroutine call with a 2-byte call instruction (CALLF).
User's Manual U14260EJ3V1UD
67
CHAPTER 5
CPU ARCHITECTURE
5.1.2 Internal data memory space The PD780078, 780078Y Subseries incorporate the following on-chip high-speed RAMs. (1) Internal high-speed RAM The 1024-byte area FB00H to FEFFH is allocated to the internal high-speed RAM. The 32-byte area FEE0H to FEFFH is allocated to four general-purpose register banks composed of eight 8-bit registers. This area cannot be used as a program area in which instructions are written for execution. The internal high-speed RAM can also be used as a stack memory. (2) Internal expansion RAM The 1024-byte area F400H to F7FFH is allocated to the internal expansion RAM. Like the internal high-speed RAM, the internal expansion RAM can be used as a normal data area, but it can also be used as a program area in which instructions are written for execution. The internal expansion RAM cannot be used as a stack memory. 5.1.3 Special function register (SFR) area On-chip peripheral hardware special function registers (SFR) are allocated in the area FF00H to FFFFH (refer to 5.2.3 Special function registers (SFR) and Table 5-3 Special Function Register List). Caution Do not access addresses where an SFR is not assigned. 5.1.4 External memory space The external memory space is accessible using the memory expansion mode register (MEM). External memory space can store program, table data, etc., and allocate peripheral devices.
68
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.1.5 Data memory addressing Addressing refers to the method of specifying the address of the instruction to be executed next or the address of the register or memory relevant to the execution of instructions. Several addressing modes are provided for addressing the memory relevant to the execution of instructions for the PD780078, 780078Y Subseries, based on operability and other considerations. For areas containing data memory in particular, special addressing methods designed for the functions of special function registers (SFR) and general-purpose registers are available for use. Figures 5-4 to 5-6 show the correspondence between data memory and addressing. For details of each addressing mode, see 5.4 Operand Address Addressing. Figure 5-4. Correspondence Between Data Memory and Addressing (PD780076, 780076Y)
FFFFH
FF20H FF1FH FF00H FEFFH FEE0H FEDFH
Special function registers (SFRs) 256 x 8 bits
SFR addressing
General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits
Register addressing Short direct addressing
FE20H FE1FH FB00H FAFFH Reserved F800H F7FFH Internal expansion RAM 1024 x 8 bits F400H F3FFH Direct addressing Register indirect addressing Based addressing Based indexed addressing
External memory 13312 x 8 bits
C000H BFFFH Internal ROM 49152 x 8 bits 0000H
User's Manual U14260EJ3V1UD
69
CHAPTER 5
CPU ARCHITECTURE
Figure 5-5. Correspondence Between Data Memory and Addressing (PD780078, 780078Y)
FFFFH
FF20H FF1FH FF00H FEFFH FEE0H FEDFH
Special function registers (SFRs) 256 x 8 bits
SFR addressing
General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits
Register addressing Short direct addressing
FE20H FE1FH FB00H FAFFH Reserved F800H F7FFH Internal expansion RAM 1024 x 8 bits F400H F3FFH Direct addressing Register indirect addressing Based addressing Based indexed addressing
External memory 1024 x 8 bits
F000H EFFFH Internal ROM 61440 x 8 bits 0000H
70
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
Figure 5-6. Correspondence Between Data Memory and Addressing (PD78F0078, 78F0078Y)
FFFFH
FF20H FF1FH FF00H FEFFH FEE0H FEDFH
Special function registers (SFRs) 256 x 8 bits
SFR addressing
General-purpose registers 32 x 8 bits Internal high-speed RAM 1024 x 8 bits
Register addressing Short direct addressing
FE20H FE1FH FB00H FAFFH Reserved F800H F7FFH Internal expansion RAM 1024 x 8 bits F400H F3FFH Direct addressing Register indirect addressing Based addressing Based indexed addressing
External memory 1024 x 8 bits
F000H EFFFH Flash memory 61440 x 8 bits 0000H
User's Manual U14260EJ3V1UD
71
CHAPTER 5
CPU ARCHITECTURE
5.2 Processor Registers
The PD780078, 780078Y Subseries incorporate the following processor registers. 5.2.1 Control registers The control registers control the program sequence, statuses and stack memory. The control registers consist of a program counter (PC), a program status word (PSW) and a stack pointer (SP). (1) Program counter (PC) The program counter is a 16-bit register which holds the address information of the next program to be executed. In normal operation, the PC is automatically incremented according to the number of bytes of the instruction to be fetched. When a branch instruction is executed, immediate data and register contents are set. RESET input sets the reset vector table values at addresses 0000H and 0001H to the program counter. Figure 5-7. Program Counter Format
15 PC PC15 PC14 PC13 PC12 PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 0 PC0
(2) Program status word (PSW) The program status word is an 8-bit register consisting of various flags to be set/reset by instruction execution. Program status word contents are automatically stacked upon interrupt request generation or PUSH PSW instruction execution and are automatically reset upon execution of the RETB, RETI and POP PSW instructions. RESET input sets the PSW to 02H. Figure 5-8. Program Status Word Format
7 PSW IE Z RBS1 AC RBS0 0 ISP 0 CY
72
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
(a) Interrupt enable flag (IE) This flag controls the interrupt request acknowledgment operations of the CPU. When IE is 0 the interrupt disabled (DI) state is set, and only non-maskable interrupt requests become acknowledgeable. Other interrupt requests are all disabled. When IE is 1 the interrupt enabled (EI) state is set and interrupt request acknowledgment enable is controlled by the in-service priority flag (ISP), the interrupt mask flag corresponding to each interrupt source and the priority specification flag. IE is reset (0) upon DI instruction execution or interrupt acknowledgment and is set (1) upon EI instruction execution. (b) Zero flag (Z) When the operation result is zero, this flag is set (1). It is reset (0) in all other cases. (c) Register bank select flags (RBS0 and RBS1) These are 2-bit flags used to select one of the four register banks. The 2-bit information which indicates the register bank selected by SEL RBn instruction execution is stored in these flags. (d) Auxiliary carry flag (AC) If the operation result has a carry from bit 3 or a borrow at bit 3, this flag is set (1). It is reset (0) in all other cases. (e) In-service priority flag (ISP) This flag manages the priority of acknowledgeable maskable vectored interrupts. When this flag is 0, lowlevel vectored interrupt requests specified by the priority specification flag register (PR0L, PR0H, PR1L) (refer to 19.3 (3) Priority specification flag registers (PR0L, PR0H, PR1L)) are disabled for acknowledgment. Actual interrupt request acknowledgment is controlled by the interrupt enable flag (IE). (f) Carry flag (CY) This flag stores an overflow or underflow upon add/subtract instruction execution. It stores the shift-out value upon rotate instruction execution and functions as a bit accumulator during bit manipulation instruction execution. (3) Stack pointer (SP) This is a 16-bit register used to hold the start address of the memory stack area. Only the internal high-speed RAM area (FB00H to FEFFH) can be set as the stack area.
User's Manual U14260EJ3V1UD
73
CHAPTER 5
CPU ARCHITECTURE
Figure 5-9. Stack Pointer Format
15 SP SP15 SP14 SP13 SP12 SP11 SP10 SP9 SP8 SP7 SP6 SP5 SP4 SP3 SP2 SP1 0 SP0
The SP is decremented ahead of write (save) to the stack memory and is incremented after read (reset) from the stack memory. Each stack operation saves/resets data as shown in Figures 5-10 and 5-11. Caution Since RESET input makes the SP contents undefined, be sure to initialize the SP before using the stack memory. Figure 5-10. Data to Be Saved to Stack Memory (a) PUSH rp instruction (when SP is FEE0H)
SP
FEE0H
FEE0H FEDFH Register pair upper Register pair lower
SP
FEDEH
FEDEH
(b) CALL, CALLF, CALLT instructions (when SP is FEE0H)
SP
FEE0H
FEE0H FEDFH PC15 to PC8 PC7 to PC0
SP
FEDEH
FEDEH
(c) Interrupt, BRK instruction (when SP is FEE0H)
SP
FEE0H
FEE0H FEDFH FEDEH PSW PC15 to PC8 PC7 to PC0
SP
FEDDH
FEDDH
74
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
Figure 5-11. Data to Be Restored from Stack Memory (a) POP rp instruction (when SP is FEDEH)
SP
FEE0H
FEE0H FEDFH Register pair upper Register pair lower
SP
FEDEH
FEDEH
(b) RET instruction (when SP is FEDEH)
SP
FEE0H
FEE0H FEDFH PC15 to PC8 PC7 to PC0
SP
FEDEH
FEDEH
(c) RETI, RETB instructions (when SP is FEDDH)
SP
FEE0H
FEE0H FEDFH FEDEH PSW PC15 to PC8 PC7 to PC0
SP
FEDDH
FEDDH
5.2.2 General-purpose registers General-purpose registers are mapped at particular addresses (FEE0H to FEFFH) of the data memory. They consist of 4 banks, each bank consisting of eight 8-bit registers (X, A, C, B, E, D, L, and H). Each register can be used as an 8-bit register, and two 8-bit registers can also be used in pairs as a 16-bit register (AX, BC, DE, and HL). They can be described in terms of function names (X, A, C, B, E, D, L, H, AX, BC, DE, and HL) and absolute names (R0 to R7 and RP0 to RP3). Register banks to be used for instruction execution are set by the CPU control instruction (SEL RBn). Because of the 4-register bank configuration, an efficient program can be created by switching between a register for normal processing and a register for interrupts for each bank.
User's Manual U14260EJ3V1UD
75
CHAPTER 5
CPU ARCHITECTURE
Figure 5-12. General-Purpose Register Configuration (a) Absolute name
16-bit processing FEFFH R7 BANK0 FEF8H RP3 R6 R5 BANK1 FEF0H RP1 R2 R1 BANK3 FEE0H 15 0 7 0 RP0 R0 RP2 R4 R3 BANK2 FEE8H 8-bit processing
(b) Function name
16-bit processing FEFFH H BANK0 FEF8H HL L D BANK1 FEF0H BC C A BANK3 FEE0H 15 0 7 0 AX X DE E B BANK2 FEE8H 8-bit processing
76
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.2.3 Special function registers (SFR) Unlike a general-purpose register, each special function register has a special function. They are allocated in the area FF00H to FFFFH. The special function registers can be manipulated like the general-purpose registers, with operation, transfer and bit manipulation instructions. The manipulatable bit units, 1, 8, and 16, depend on the special function register type. Each manipulation bit unit can be specified as follows. * 1-bit manipulation Describe the symbol reserved by assembler for the 1-bit manipulation instruction operand (sfr.bit). This manipulation can also be specified with an address. * 8-bit manipulation Describe the symbol reserved by assembler for the 8-bit manipulation instruction operand (sfr). This manipulation can also be specified with an address. * 16-bit manipulation Describe the symbol reserved by assembler for the 16-bit manipulation instruction operand (sfrp). When addressing an address, describe an even address. Table 5-3 gives a list of the special function registers. The meanings of items in the table are as follows. * Symbol Symbol indicating the address of a special function register. It is a reserved word in the RA78K0, and is defined as an sfr variable using the #pragma sfr directive in the CC78K0. When using the RA78K0, ID78K0-NS, ID78K0, or SM78K0, symbols can be written as an instruction operand. * R/W Indicates whether the corresponding special function register can be read or written. R/W: Read/write R: W: Read only Write only
* Manipulatable bit units Indicates the manipulatable bit unit (1, 8, or 16). "-" indicates a bit unit for which manipulation is not possible. * After reset Indicates each register status upon RESET input.
User's Manual U14260EJ3V1UD
77
CHAPTER 5
CPU ARCHITECTURE
Table 5-3. Special Function Register List (1/3)
Manipulatable Bit Unit 1 Bit FF00H FF01H FF02H FF03H FF04H FF05H FF06H FF07H FF08H FF0AH FF0BH FF0CH FF0DH FF0EH FF0FH FF10H FF11H FF12H FF13H FF14H FF15H FF16H FF17H FF18H Transmit shift register 0 Receive buffer register 0 FF19H FF1AH FF1BH FF1FH FF20H FF22H FF23H FF24H FF25H FF26H FF27H FF28H Transmit buffer register 1 Serial I/O shift register 1 Serial I/O shift register 3 IIC shift register 0Note TXS0 RXB0 SOTB1 SIO1 SIO3 IIC0 PM0 PM2 PM3 PM4 PM5 PM6 PM7 PM8 W R R/W R R/W 8-bit timer compare register 50 8-bit timer compare register 51 8-bit timer counter 50 8-bit timer counter 51 Transmit buffer register 2 Receive buffer register 2 A/D conversion result register 0 TXB2 RXB2 ADCR0 CR50 CR51 TM5 TM50 TM51 R/W R R R/W -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 00H FFH Undefined FFH -- -- FFH FFH 0000H -- -- 00H Undefined 16-bit timer counter 00 TM00 R -- -- 0000H 16-bit timer capture/compare register 010 CR010 -- -- Port register 0 Port register 1 Port register 2 Port register 3 Port register 4 Port register 5 Port register 6 Port register 7 Port register 8 16-bit timer capture/compare register 000 P0 P1 P2 P3 P4 P5 P6 P7 P8 CR000 R/W R R/W -- 8 Bits 16 Bits -- -- -- -- -- -- -- -- -- -- Undefined 00H Undefined 00H
Address
Special Function Register (SFR) Name
Symbol
R/W
After Reset
Port mode register 0 Port mode register 2 Port mode register 3 Port mode register 4 Port mode register 5 Port mode register 6 Port mode register 7 Port mode register 8
Note
PD780078Y Subseries only
78
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
Table 5-3. Special Function Register List (2/3)
Manipulatable Bit Unit 1 Bit FF30H FF32H FF33H FF34H FF35H FF36H FF37H FF38H FF40H FF41H FF42H FF47H FF48H FF49H FF60H FF61H FF62H FF63H FF64H FF65H FF66H FF67H FF68H FF69H FF6AH FF6BH FF6CH FF6DH FF70H FF71H FF78H FF79H FF80H FF81H FF90H FF91H FF92H FF93H 8-bit timer mode control register 50 Timer clock select register 50 8-bit timer mode control register 51 Timer clock select register 51 A/D converter mode register 0 Analog input channel specification register 0 Asynchronous serial interface mode register 2 Transfer mode specification register 2 Clock select register 2 Baud rate generator control register 2 TMC50 TCL50 TMC51 TCL51 ADM0 ADS0 ASIM2 TRMC2 CKSEL2 BRGC2 R/W -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 02H 00H 00H 16-bit timer counter 01 TM01 R -- -- 0000H 16-bit timer capture/compare register 011 CR011 -- -- Pull-up resistor option register 0 Pull-up resistor option register 2 Pull-up resistor option register 3 Pull-up resistor option register 4 Pull-up resistor option register 5 Pull-up resistor option register 6 Pull-up resistor option register 7 Pull-up resistor option register 8 Clock output select register Watch timer operation mode register Watchdog timer clock select register Memory expansion mode register External interrupt rising edge enable register External interrupt falling edge enable register 16-bit timer mode control register 00 Prescaler mode register 00 Capture/compare control register 00 16-bit timer output control register 00 16-bit timer mode control register 01 Prescaler mode register 01 Capture/compare control register 01 16-bit timer output control register 01 16-bit timer capture/compare register 001 PU0 PU2 PU3 PU4 PU5 PU6 PU7 PU8 CKS WTM WDCS MEM EGP EGN TMC00 PRM00 CRC00 TOC00 TMC01 PRM01 CRC01 TOC01 CR001 R/W -- -- -- -- 8 Bits 16 Bits -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- Undefined 00H
Address
Special Function Register (SFR) Name
Symbol
R/W
After Reset
User's Manual U14260EJ3V1UD
79
CHAPTER 5
CPU ARCHITECTURE
Table 5-3. Special Function Register List (3/3)
Manipulatable Bit Unit 1 Bit FF94H FF95H FFA0H FFA1H FFA2H FFA8H FFA9H FFAAH FFABH FFB0H FFB1H FFB8H FFE0H FFE1H FFE2H FFE4H FFE5H FFE6H FFE8H FFE9H FFEAH FFF0H FFF4H FFF8H FFF9H FFFAH FFFBH Asynchronous serial interface status register 2 Asynchronous serial interface transmit status register 2 Asynchronous serial interface mode register 0 Asynchronous serial interface status register 0 Baud rate generator control register 0 IIC control register IIC status register 0Note 1 ASIS2 ASIF2 ASIM0 ASIS0 BRGC0 IICC0 IICS0 0Note 1 IICCL0 SVA0 CSIM1 CSIC1 CSIM3 IF0 IF0L IF0H IF1L MK0 MK0L MK0H MK1L PR0 PR0L PR0H PR1L IMS IXS MM WDTM OSTS PCC R R/W R/W R R/W R -- -- -- -- -- -- -- -- 8 Bits 16 Bits -- -- -- -- -- -- -- CFHNote 2 0CHNote 3 10H 00H 04H -- -- FFH -- -- -- -- -- -- -- -- -- -- -- -- 10H 00H 00H
Address
Special Function Register (SFR) Name
Symbol
R/W
After Reset
0Note 1
IIC transfer clock select register Slave address register 0Note 1
Serial operation mode register 1 Serial clock select register 1 Serial operation mode register 3 Interrupt request flag register 0L Interrupt request flag register 0H Interrupt request flag register 1L Interrupt mask flag register 0L Interrupt mask flag register 0H Interrupt mask flag register 1L Priority level specification flag register 0L Priority level specification flag register 0H Priority level specification flag register 1L Memory size switching register Internal expansion RAM size switching register Memory expansion wait setting register Watchdog timer mode register Oscillation stabilization time select register Processor clock control register
Notes 1. PD780078Y Subseries only 2. Although the default value of this register is CFH, set the value corresponding to each product as indicated below.
PD780076, 780076Y: PD780078, 780078Y:
CCH CFH
PD78F0078, 78F0078Y: Value for mask ROM version
3. Although the default value of this register is 0CH, initialize this register to 0AH.
80
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.3 Instruction Address Addressing
An instruction address is determined by program counter (PC) contents and is normally incremented (+1 for each byte) automatically according to the number of bytes of an instruction to be fetched each time another instruction is executed. When a branch instruction is executed, the branch destination information is set to the PC and branched by the following addressing (for details of instructions, refer to 78K/0 Series Instructions User's Manual (U12326E)). 5.3.1 Relative addressing [Function] The value obtained by adding 8-bit immediate data (displacement value: jdisp8) of an instruction code to the start address of the following instruction is transferred to the program counter (PC) and branched. The displacement value is treated as signed two's complement data (-128 to +127) and bit 7 becomes a sign bit. In other words, relative addressing consists of relative branching from the start address of the following instruction to the -128 to +127 range. This function is carried out when the BR $addr16 instruction or a conditional branch instruction is executed. [Illustration]
15 PC + 15 8 7 S jdisp8 15 PC 0 6 0 0 ... PC indicates the start address of the instruction after the BR instruction.
When S = 0, all bits of are 0. When S = 1, all bits of are 1.
User's Manual U14260EJ3V1UD
81
CHAPTER 5
CPU ARCHITECTURE
5.3.2 Immediate addressing [Function] Immediate data in the instruction word is transferred to the program counter (PC) and branched. This function is carried out when the CALL !addr16 or BR !addr16 or CALLF !addr11 instruction is executed. CALL !addr16 and BR !addr16 instructions can be branched to the entire memory space. The CALLF !addr11 instruction is branched to the 0800H to 0FFFH area. [Illustration] In the case of CALL !addr16 and BR !addr16 instructions
7 CALL or BR Low Addr. High Addr. 0
15 PC
87
0
In the case of CALLF !addr11 instruction
76 fa10-8 fa7-0 4 3 CALLF 0
15 PC 0 0 0 0
11 10 1
87
0
82
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.3.3 Table indirect addressing [Function] Table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the immediate data of an operation code are transferred to the program counter (PC) and branched. This function is carried out when the CALLT [addr5] instruction is executed. This instruction references the address stored in the memory table from 40H to 7FH, and allows branching to the entire memory space. [Illustration]
7 Operation code 1 6 1 5 ta4--0 1 0 1
15 Effective address 0 0 0 0 0 0 0
8 0
7 0
6 1
5
10 0
7
Memory (Table) Low Addr.
0
Effective address + 1
High Addr.
15 PC
8
7
0
User's Manual U14260EJ3V1UD
83
CHAPTER 5
CPU ARCHITECTURE
5.3.4 Register addressing [Function] Register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC) and branched. This function is carried out when the BR AX instruction is executed. [Illustration]
7 rp A 0 7 X 0
15 PC
8
7
0
84
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.4 Operand Address Addressing
The following methods are available to specify the register and memory (addressing) which undergo manipulation during instruction execution. 5.4.1 Implied addressing [Function] The register which functions as an accumulator (A, AX) in the general-purpose register area is automatically (implicitly) addressed. Of the PD780078, 780078Y Subseries instruction words, the following instructions employ implied addressing.
Instruction MULU DIVUW ADJBA/ADJBS ROR4/ROL4 Register to Be Specified by Implied Addressing Register A for multiplicand and register AX for product storage Register AX for dividend and quotient storage Register A for storage of numeric values which become decimal correction targets Register A for storage of digit data which undergoes digit rotation
[Operand format] Because implied addressing can be automatically employed with an instruction, no particular operand format is necessary. [Description example] In the case of MULU X With an 8-bit x 8-bit multiply instruction, the product of register A and register X is stored in AX. In this example, the A and AX registers are specified by implied addressing.
User's Manual U14260EJ3V1UD
85
CHAPTER 5
CPU ARCHITECTURE
5.4.2 Register addressing [Function] The general-purpose register to be specified is accessed as an operand with the register specify code (Rn and RPn) of an instruction word in the registered bank specified by the register bank select flags (RBS0 and RBS1). Register addressing is carried out when an instruction with the following operand format is executed. When an 8-bit register is specified, one of the eight registers is specified with 3 bits in the operation code. [Operand format]
Identifier r rp Description X, A, C, B, E, D, L, H AX, BC, DE, HL
`r' and `rp' can be described by absolute names (R0 to R7 and RP0 to RP3) as well as function names (X, A, C, B, E, D, L, H, AX, BC, DE, and HL). [Description example] MOV A, C; when selecting C register as r Operation code 01100010 Register specify code INCW DE; when selecting DE register pair as rp Operation code 10000100 Register specify code
86
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.4.3 Direct addressing [Function] The memory to be manipulated is addressed with immediate data in an instruction word becoming an operand address. [Operand format]
Identifier addr16 Description Label or 16-bit immediate data
[Description example] MOV A, !0FE00H; when setting !addr16 to FE00H Operation code 10001110 00000000 11111110 [Illustration] Opcode 00H FEH
7 Opcode addr16 (lower) addr16 (higher)
0
Memory
User's Manual U14260EJ3V1UD
87
CHAPTER 5
CPU ARCHITECTURE
5.4.4 Short direct addressing [Function] The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word. This addressing is applied to the 256-byte space FE20H to FF1FH. Internal RAM and special function registers (SFR) are mapped at FE20H to FEFFH and FF00H to FF1FH, respectively. If the SFR area (FF00H to FF1FH) where short direct addressing is applied, ports which are frequently accessed in a program and compare and capture registers of the timer/event counter are mapped, and these SFRs can be manipulated with a small number of bytes and clocks. When 8-bit immediate data is at 20H to FFH, bit 8 of an effective address is set to 0. When it is at 00H to 1FH, bit 8 is set to 1. Refer to the [Illustration] below. [Operand format]
Identifier saddr saddrp Description Label or immediate data indicating FE20H to FF1FH Label or immediate data indicating FE20H to FF1FH (even address only)
[Description example] MOV 0FE30H, A; when transferring the value in register A to saddr (FE30H) Operation code 11110010 00110000 [Illustration]
7 Opcode saddr-offset 0
Opcode 30H (saddr-offset)
Short direct memory 15 Effective Address 1 1 1 1 1 1 1 87 0
When 8-bit immediate data is 20H to FFH, = 0 When 8-bit immediate data is 00H to 1FH, = 1
88
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.4.5 Special function register (SFR) addressing [Function] The memory-mapped special function register (SFR) is addressed with 8-bit immediate data in an instruction word. This addressing is applied to the 240-byte spaces FF00H to FFCFH and FFE0H to FFFFH. However, the SFRs mapped at FF00H to FF1FH can be accessed with short direct addressing. [Operand format]
Identifier sfr sfrp Description Special function register name 16-bit manipulatable special function register name (even address only)
[Description example] MOV PM0, A; when selecting PM0 (FF20H) as sfr Operation code 11110110 00100000 [Illustration]
7 Opcode sfr-offset 0
Opcode 20H (sfr-offset)
SFR 15 Effective address 1 1 1 1 1 1 1 87 1 0
User's Manual U14260EJ3V1UD
89
CHAPTER 5
CPU ARCHITECTURE
5.4.6 Register indirect addressing [Function] Register pair contents specified with a register pair specify code in an instruction word of the register bank specified by the register bank select flags (RBS0 and RBS1) serve as an operand address for addressing the memory to be manipulated. This addressing can be carried out for all the memory spaces. [Operand format]
Identifier -- [DE], [HL] Description
[Description example] MOV A, [DE]; when selecting [DE] as register pair Operation code [Illustration]
16 DE D 87 E The memory address specified with the register pair DE 0
10000101
7 The contents of the memory addressed are transferred. 7 A 0
Memory
0
90
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.4.7 Based addressing [Function] 8-bit immediate data is added as offset data to the contents of the base register, that is, the HL register pair in an instruction word of the register bank specified by the register bank select flags (RBS0 and RBS1) and the sum is used to address the memory. Addition is performed by expanding the offset data as a positive number to 16 bits. A carry from the 16th bit is ignored. This addressing can be carried out for all the memory spaces. [Operand format]
Identifier -- [HL + byte] Description
[Description example] MOV A, [HL + 10H]; when setting byte to 10H Operation code 10101110 00010000 [Illustration]
16 HL H 87 L +10 7 The contents of the addressed memory is transferred. 7 A Memory 0 0
0
User's Manual U14260EJ3V1UD
91
CHAPTER 5
CPU ARCHITECTURE
5.4.8 Based indexed addressing [Function] The B or C register contents specified in an instruction are added to the contents of the base register, that is, the HL register pair in an instruction word of the register bank specified by the register bank select flags (RBS0 and RBS1) and the sum is used to address the memory. Addition is performed by expanding the B or C register contents as a positive number to 16 bits. A carry from the 16th bit is ignored. This addressing can be carried out for all the memory spaces. [Operand format]
Identifier -- [HL + B], [HL + C] Description
[Description example] In the case of MOV A, [HL + B] (selecting the B register) Operation code [Illustration]
16 HL H + 7 B 87 L 0
10101011
0
0
7 The contents of the addressed memory is transferred. 7 A 0
Memory
92
User's Manual U14260EJ3V1UD
CHAPTER 5
CPU ARCHITECTURE
5.4.9 Stack addressing [Function] The stack area is indirectly addressed with the stack pointer (SP) contents. This addressing method is automatically employed when the PUSH, POP, subroutine call and return instructions are executed or the register is saved/reset upon generation of an interrupt request. Stack addressing can be used to address the internal high-speed RAM area only. [Description example] In the case of PUSH DE (saving the DE register) Operation code [Illustration]
7 SP FEE0H FEE0H FEDFH SP FEDEH FEDEH D E Memory 0
10110101
User's Manual U14260EJ3V1UD
93
CHAPTER 6
PORT FUNCTIONS
6.1 Port Functions
The PD780078, 780078Y Subseries incorporate eight input ports and 44 I/O ports. Figure 6-1 shows the port configuration. Every port is capable of 1-bit and 8-bit manipulations and can carry out considerably varied control operations. Besides port functions, the ports can also serve as on-chip hardware I/O pins. Figure 6-1. Port Types
Port 5 Port 6 Port 7 Port 8
P50
P00
P03 P10 P57 P64
Port 0 Port 1 Port 2
P67 P70
P17 P20
P75 P80
P25 P30
P36 P40
Port 3
Port 4
P47
94
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Table 6-1. Port Functions (PD780078 Subseries)
Alternate Function INTP0 INTP1 INTP2 INTP3/ADTRG Port 1 8-bit input-only port. Port 2 6-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. ANI0 to ANI7 SI1 SO1 SCK1 RxD0 TxD0 ASCK0 Port 3 7-bit I/O port. Input/output mode can be specified in 1-bit units. N-ch open-drain I/O port. An on-chip pull-up resistor can be specified by a mask option (mask ROM version only). LEDs can be driven directly. An on-chip pull-up resistor can be used by setting software. SI3/TXD2 SO3/RXD2 SCK3/ASCK2 Port 4 8-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Interrupt request flag (KRIF) is set to 1 by falling edge detection. Port 5 8-bit I/O port. LEDs can be driven directly. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 6 4-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 7 6-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. AD0 to AD7 --
Pin Name P00 P01 P02 P03 P10 to P17 P20 P21 P22 P23 P24 P25 P30 P31 P32 P33 P34 P35 P36 P40 to P47 Port 0 4-bit I/O port.
Function
Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
P50 to P57
A8 to A15
P64 P65 P66 P67 P70 P71 P72 P73 P74 P75 P80
RD WR WAIT ASTB TI000/TO00 TI010 TI50/TO50 TI51/TO51 TI011/PCL TI001/TO01/BUZ
Port 8 1-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
SS1
User's Manual U14260EJ3V1UD
95
CHAPTER 6
PORT FUNCTIONS
Table 6-2. Port Functions (PD780078Y Subseries)
Alternate Function INTP0 INTP1 INTP2 INTP3/ADTRG Port 1 8-bit input-only port. Port 2 6-bit I/O port Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. ANI0 to ANI7 SI1 SO1 SCK1 RxD0 TxD0 ASCK0 Port 3 7-bit I/O port. Input/output mode can be specified in 1-bit units. N-ch open-drain I/O port. An on-chip pull-up resistor can be specified by a mask option (P30 and P31 are mask ROM version only). LEDs can be driven directly. An on-chip pull-up resistor can be used by setting software. SDA0 SCL0 SI3/TXD2 SO3/RXD2 SCK3/ASCK2 Port 4 8-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Interrupt request flag (KRIF) is set to 1 by falling edge detection. Port 5 8-bit I/O port. LEDs can be driven directly. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 6 4-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. Port 7 6-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software. AD0 to AD7 --
Pin Name P00 P01 P02 P03 P10 to P17 P20 P21 P22 P23 P24 P25 P30 P31 P32 P33 P34 P35 P36 P40 to P47 Port 0 4-bit I/O port.
Function
Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
P50 to P57
A8 to A15
P64 P65 P66 P67 P70 P71 P72 P73 P74 P75 P80
RD WR WAIT ASTB TI000/TO00 TI010 TI50/TO50 TI51/TO51 TI011/PCL TI001/TO01/BUZ
Port 8 1-bit I/O port. Input/output mode can be specified in 1-bit units. An on-chip pull-up resistor can be used by setting software.
SS1
96
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.2 Port Configuration
A port consists of the following hardware. Table 6-3. Port Configuration
Item Control registers Configuration Port mode register (PMm: m = 0, 2 to 8) Port register (Pm: m = 0 to 8) Pull-up resistor option register (PUm: m = 0, 2 to 8) Total: 52 ports (8 inputs, 44 I/O) * Mask ROM version Total: 44 (software control: 40, mask option: 4Note) * Flash memory version Total: 40
Ports Pull-up resistor
Note Two for the PD780078Y Subseries. 6.2.1 Port 0 Port 0 is a 4-bit I/O port with an output latch. Port 0 can be set to the input or output mode in 1-bit units using port mode register 0 (PM0). An on-chip pull-up resistor can be connected to P00 to P03 in 1-bit units using pull-up resistor option register 0 (PU0). This port can also be used for external interrupt request input and A/D converter external trigger input. RESET input sets port 0 to input mode. Figure 6-2 shows a block diagram of port 0. Cautions 1. Port 0 functions alternately as an external interrupt request input pin. If the output mode of the port function is specified and the output level of the port is changed while interrupts are not disabled by the external interrupt rising edge enable register (EGP) and external interrupt falling edge enable register (EGN), the interrupt request flag is set. Thus, when the output mode is used, set the interrupt mask flag to 1. 2. When the external interrupt request function is switched to the port function, edge detection may be performed. Therefore, set bit n (EGPn) of EGP and bit n (EGNn) of EGN to 0 before selecting the port mode. 3. When using P03/INTP3/ADTRG as an A/D converter external trigger input, specify valid edges by setting bits 1 and 2 (EGA00 and EGA01) of A/D converter mode register 0 (ADM0) and set the interrupt mask flag (PMK3) to 1. Remark n = 0 to 3
User's Manual U14260EJ3V1UD
97
CHAPTER 6
PORT FUNCTIONS
Figure 6-2. Block Diagram of P00 to P03
VDD0 WRPU PU0 PU00 to PU03 P-ch
Alternate function RD
Internal bus Selector
WRPORT P00/INTP0 Output latch (P00 to P03) WRPM PM0 PM00 to PM03 P02/INTP2, P03/INTP3/ADTRG
PU0: PM0: RD:
Pull-up resistor option register 0 Port mode register 0 Read signal
WRxx: Write signal
98
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.2.2 Port 1 Port 1 is an 8-bit input-only port. This port can also be used for A/D converter analog input. Figure 6-3 shows a block diagram of port 1. Figure 6-3. Block Diagram of P10 to P17
RD
Internal bus
A/D converter
P10/ANI0 to P17/ANI7
RD: Read signal
User's Manual U14260EJ3V1UD
99
CHAPTER 6
PORT FUNCTIONS
6.2.3 Port 2 Port 2 is a 6-bit I/O port with an output latch. Port 2 can be set to the input or output mode in 1-bit units using port mode register 2 (PM2). An on-chip pull-up resistor can be connected to P20 to P25 in 1-bit units using pull-up resistor option register 2 (PU2). This port can also be used for serial interface data I/O and clock I/O. RESET input sets port 2 to input mode. Figures 6-4 to 6-7 show block diagrams of port 2. Caution When using P22/SCK1 as a general-purpose port, set bit 4 (CKP1) of serial clock select register 1 (CSIC1) to 1. Figure 6-4. Block Diagram of P20, P23, and P25
VDD0 WRPU PU2 PU20, PU23, PU25 P-ch
Alternate function RD
Internal bus Selector
WRPORT Output latch (P20, P23, P25) WRPM PM2 PM20, PM23, PM25 P20/SI1, P23/RxD0, P25/ASCK0
PU2: PM2: RD:
Pull-up resistor option register 2 Port mode register 2 Read signal
WRxx: Write signal
100
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-5. Block Diagram of P21
VDD0 WRPU PU2 PU21 RD P-ch
Internal bus
WRPORT Output latch (P21) WRPM PM2 PM21
Selector
P21/SO1
Alternate function SS1
PU2: PM2: RD: SS1:
Pull-up resistor option register 2 Port mode register 2 Read signal 3-wire SIO chip select signal Caution P21/SO1 has a function to forcibly turn off the output buffer via SS1 (3-wire SIO chip select signal).
WRxx: Write signal
User's Manual U14260EJ3V1UD
101
CHAPTER 6
PORT FUNCTIONS
Figure 6-6. Block Diagram of P22
VDD0 WRPU PU2 PU22 P-ch
Alternate function RD
Selector
Internal bus
WRPORT Output latch (P22) WRPM PM2 PM22
P22/SCK1
Alternate function
PU2: PM2: RD:
Pull-up resistor option register 2 Port mode register 2 Read signal
WRxx: Write signal
102
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-7. Block Diagram of P24
VDD0 WRPU PU2 PU24 RD P-ch
Internal bus
WRPORT Output latch (P24) WRPM PM2 PM24
Selector
P24/TxD0
Alternate function
PU2: PM2: RD:
Pull-up resistor option register 2 Port mode register 2 Read signal
WRxx: Write signal
User's Manual U14260EJ3V1UD
103
CHAPTER 6
PORT FUNCTIONS
6.2.4 Port 3 (PD780078 Subseries) Port 3 is a 7-bit I/O port with an output latch. Port 3 can be set to the input or output mode in 1-bit units using port mode register 3 (PM3). This port has the following functions related to pull-up resistors. These functions differ depending on the port's higher 3 bits/lower 4 bits, and whether the product is a mask ROM version or a flash memory version. Table 6-4. Pull-Up Resistor of Port 3 (PD780078 Subseries)
Higher 3 Bits (P34 to P36 Pins) Mask ROM version An on-chip pull-up resistor can be connected in 1-bit units by PU3 Lower 4 Bits (P30 to P33 Pins) An on-chip pull-up resistor can be specified in 1-bit units by a mask option An on-chip pull-up resistor is not provided
Flash memory version
PU3: Pull-up resistor option register 3 The P30 to P33 pins can drive LEDs directly. The P34 to P36 pins can also be used for serial interface data I/O and clock I/O. RESET input sets port 3 to input mode. Figures 6-8 to 6-10 show block diagrams of port 3. Figure 6-8. Block Diagram of P30 and P31 (PD780078 Subseries)
RD VDD0
Mask option resistor
Mask ROM version only No pull-up resistor for flash memory version
Selector
Internal bus
WRPORT
P30, P31
Output latch (P30, P31)
N-ch
WRPM
PM3
PM30, PM31
PM3: RD:
Port mode register 3 Read signal
WRxx: Write signal
104
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-9. Block Diagram of P32 and P33 (PD780078 Subseries)
VDD0
Mask option resistor
RD
Selector
Mask ROM version only No pull-up resistor for flash memory version
Internal bus
WRPORT
P32, P33
Output latch (P32, P33)
N-ch
WRPM
PM3
PM32, PM33
PM3: RD:
Port mode register 3 Read signal
WRxx: Write signal
User's Manual U14260EJ3V1UD
105
CHAPTER 6
PORT FUNCTIONS
Figure 6-10. Block Diagram of P34 to P36 (PD780078 Subseries)
VDD0 WRPU PU3 PU34 to PU36 P-ch
Alternate function RD
Internal bus
WRPORT Output latch (P34 to P36) WRPM PM3 PM34 to PM36 P34/SI3/TxD2, P35/SO3/RxD2, P36/SCK3/ASCK2
Alternate function
PU3: PM3: RD:
Pull-up resistor option register 3 Port mode register 3 Read signal
WRxx: Write signal
106
User's Manual U14260EJ3V1UD
Selector
CHAPTER 6
PORT FUNCTIONS
6.2.5 Port 3 (PD780078Y Subseries) Port 3 is a 7-bit I/O port with an output latch. Port 3 can be set to the input or output mode in 1-bit units using port mode register 3 (PM3). This port has the following functions related to pull-up resistors. These functions differ depending on the bit location and whether the product is a mask ROM version or a flash memory version. Table 6-5. Pull-Up Resistor of Port 3 (PD780078Y Subseries)
P34 to P36 Pins Mask ROM version An on-chip pull-up resistor can be connected in 1-bit units by PU3 P30 and P31 Pins An on-chip pull-up resistor can be specified in 1-bit units by mask option An on-chip pull-up resistor is not provided
Flash memory version
PU3: Pull-up resistor option register 3
Caution
The P32 and P33 pins have no pull-up resistor.
The P30 to P33 pins can drive LEDs directly. The P32 to P36 pins can also be used for serial interface data I/O and clock I/O. RESET input sets port 3 to input mode. Figures 6-11 to 6-13 show block diagrams of port 3. Figure 6-11. Block Diagram of P30 and P31 (PD780078Y Subseries)
RD VDD0
Mask option resistor
Mask ROM version only No pull-up resistor for flash memory version
Selector
Internal bus
WRPORT
P30, P31
Output latch (P30, P31)
N-ch
WRPM
PM3
PM30, PM31
PM3: RD:
Port mode register 3 Read signal
WRxx: Write signal
User's Manual U14260EJ3V1UD
107
CHAPTER 6
PORT FUNCTIONS
Figure 6-12. Block Diagram of P32 and P33 (PD780078Y Subseries)
RD
Internal bus
Selector
WRPORT
P32/SDA0, P33/SCL0
Output latch (P32, P33)
N-ch WRPM
PM3
PM32, PM33
Alternate function
PM3: RD:
Port mode register 3 Read signal
WRxx: Write signal
108
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-13. Block Diagram of P34 to P36 (PD780078Y Subseries)
VDD0 WRPU PU3 PU34 to PU36 P-ch
Alternate function RD
Selector
Internal bus
WRPORT Output latch (P34 to P36) WRPM PM3 PM34 to PM36 P34/SI3/TxD2, P35/SO3/RxD2, P36/SCK3/ASCK2
Alternate function
PU3: PM3: RD: WRxx:
Pull-up resistor option register 3 Port mode register 3 Read signal Write signal
User's Manual U14260EJ3V1UD
109
CHAPTER 6
PORT FUNCTIONS
6.2.6 Port 4 Port 4 is an 8-bit I/O port with an output latch. Port 4 can be set to the input or output mode in 1-bit units using port mode register 4 (PM4). An on-chip pull-up resistor can be connected to P40 to P47 in 1-bit units using pull-up resistor option register 4 (PU4). The interrupt request flag (KRIF) can be set to 1 by detecting falling edges. This port can also be used as an address/data bus in external memory expansion mode. RESET input sets port 4 to input mode. Figures 6-14 and 6-15 show a block diagram of port 4 and a block diagram of the falling edge detector, respectively. Cautions 1. An on-chip pull-up resistor is not disconnected even if the external memory expansion mode is set when PU4n = 1 (n = 0 to 7). 2. When using the falling edge detection interrupt (INTKR), be sure to set the memory expansion mode register (MEM) to 01H. Figure 6-14. Block Diagram of P40 to P47
VDD0
WRPU
PU4 PU40 to PU47 P-ch Alternate function
RD
Selector
Internal bus
WRPORT Output latch (P40 to P47) P40/AD0 to P47/AD7
Selector
Alternate function WRPM PM4 PM40 to PM47
Memory expansion mode register (MEM)
PU4: PM4: RD:
Pull-up resistor option register 4 Port mode register 4 Read signal
WRxx: Write signal
110
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-15. Block Diagram of Falling Edge Detector
P40 P41 P42 P43 P44 P45 P46 P47 1 when MEM = 01H Falling edge detector INTKR
User's Manual U14260EJ3V1UD
111
CHAPTER 6
PORT FUNCTIONS
6.2.7 Port 5 Port 5 is an 8-bit I/O port with an output latch. Port 5 can be set to the input or output mode in 1-bit units using port mode register 5 (PM5). An on-chip pull-up resistor can be connected to P50 to P57 in 1-bit units using pull-up resistor option register 5 (PU5). Port 5 can drive LEDs directly. This port can also be used as an address bus in external memory expansion mode. RESET input sets port 5 to input mode. Figure 6-16 shows a block diagram of port 5. Caution An on-chip pull-up resistor is not disconnected even if the external memory expansion mode is set when PU5n = 1 (n = 0 to 7). Figure 6-16. Block Diagram of P50 to P57
VDD0
WRPU
PU5 PU50 to PU57 P-ch
RD
Selector
Internal bus
WRPORT Output latch (P50 to P57) P50/A8 to P57/A15
Selector
Alternate function WRPM PM5 PM50 to PM57
Memory expansion mode register (MEM)
PU5: PM5: RD:
Pull-up resistor option register 5 Port mode register 5 Read signal
WRxx: Write signal
112
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.2.8 Port 6 Port 6 is a 4-bit I/O port with an output latch. Port 6 can be set to the input or output mode in 1-bit units using port mode register 6 (PM6). An on-chip pull-up resistor can be connected to P64 to P67 in 1-bit units using pull-up resistor option register 6 (PU6). This port can also be used for control signal output in external memory expansion mode. RESET input sets port 6 to input mode. Figures 6-17 and 6-18 show block diagrams of port 6. Cautions 1. An on-chip pull-up resistor is not disconnected even if the external memory expansion mode is set when PU6n = 1 (n = 4 to 7). 2. When external wait is not used in external memory expansion mode, P66 can be used as an I/O port. Figure 6-17. Block Diagram of P64, P65, and P67
VDD0
WRPU
PU6 PU64, PU65, PU67 P-ch
RD
Selector
Internal bus
WRPORT Output latch (P64, P65, P67) P64/RD, P65/WR, P67/ASTB
Selector
Alternate function WRPM PM6 PM64, PM65, PM67
Memory expansion mode register (MEM)
PU6: PM6: RD:
Pull-up resistor option register 6 Port mode register 6 Read signal
WRxx: Write signal
User's Manual U14260EJ3V1UD
113
CHAPTER 6
PORT FUNCTIONS
Figure 6-18. Block Diagram of P66
VDD0
WRPU
PU6 PU66 P-ch Alternate function
RD
Selector
Internal bus
WRPORT Output latch (P66) Selector P66/WAIT
WRPM
PM6 PM66
Memory expansion mode register (MEM)
PU6: PM6: RD:
Pull-up resistor option register 6 Port mode register 6 Read signal
WRxx: Write signal
114
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.2.9 Port 7 Port 7 is a 6-bit I/O port with an output latch. Port 7 can be set to the input or output mode in 1-bit units using port mode register 7 (PM7). An on-chip pull-up resistor can be connected to P70 to P75 in 1-bit units using pull-up resistor option register 7 (PU7). This port can also be used for timer I/O, clock output, and buzzer output. RESET input sets port 7 to input mode. Figures 6-19 and 6-20 show block diagrams of port 7. Figure 6-19. Block Diagram of P70 and P72 to P75
VDD0 WRPU PU7 PU70, PU72 to PU75 P-ch
Alternate function RD
Internal bus
WRPORT Output latch (P70, P72 to P75) WRPM PM7 PM70, PM72 to PM75 P70/TI000/TO00, P72/TI50/TO50, P73/TI51/TO51, P74/TI011/PCL, P75/TI001/TO01/BUZ
Alternate function
PU7: PM7: RD:
Pull-up resistor option register 7 Port mode register 7 Read signal
WRxx: Write signal
Selector
User's Manual U14260EJ3V1UD
115
CHAPTER 6
PORT FUNCTIONS
Figure 6-20. Block Diagram of P71
VDD0 WRPU PU7 PU71 P-ch
Alternate function RD
Internal bus
WRPORT Output latch (P71) WRPM PM7 PM71
Selector
P71/TI010
PU7: PM7: RD:
Pull-up resistor option register 7 Port mode register 7 Read signal
WRxx: Write signal
116
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.2.10 Port 8 Port 8 is a 1-bit I/O port with an output latch. Port 8 can be set to the input or output mode in 1-bit units using port mode register 8 (PM8). An on-chip pull-up resistor can be connected to P80 in 1-bit units using pull-up resistor option register 8 (PU8). This port can also be used for serial interface chip select input. RESET input sets port 8 to input mode. Figure 6-21 shows a block diagram of port 8. Figure 6-21. Block Diagram of P80
VDD0 WRPU PU8 PU80 P-ch
Alternate function RD Internal bus Selector WRPORT Output latch (P80) WRPM PM8 PM80
P80/SS1
PU8: PM8: RD:
Pull-up resistor option register 8 Port mode register 8 Read signal
WRxx: Write signal
User's Manual U14260EJ3V1UD
117
CHAPTER 6
PORT FUNCTIONS
6.3 Port Function Control Registers
The following three types of registers control the ports. * * * Port mode registers (PM0, PM2 to PM8) Port registers (P0 to P8) Pull-up resistor option registers (PU0, PU2 to PU8)
(1) Port mode registers (PM0, PM2 to PM8) These registers are used to set port input/output in 1-bit units. PM0 and PM2 to PM8 are independently set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM0 and PM2 to PM8 to FFH. When using a port pin as its alternate-function pin, set the port mode registers and output latches as shown in Table 6-6. Cautions 1. Pins P10 and P17 are input-only pins. 2. Port 0 functions alternately as an external interrupt request input pin. If the output mode of the port function is specified and the output level of the port is changed while interrupts are not disabled by the external interrupt rising edge enable register (EGP) and external interrupt falling edge enable register (EGN), the interrupt request flag is set. When the output mode is used, therefore, the interrupt mask flag should be set to 1 beforehand. 3. If a port has an alternate function pin and it is used as an alternate output function, set the corresponding output latches (P0 and P2 to P8) to 0.
118
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Figure 6-22. Format of Port Mode Register (PM0, PM2 to PM8)
Address: FF20H After reset: FFH Symbol PM0 7 1 6 1 R/W 5 1 4 1 3 PM03 2 PM02 1 PM01 0 PM00
Address: FF22H After reset: FFH Symbol PM2 7 1 6 1
R/W 5 PM25 4 PM24 3 PM23 2 PM22 1 PM21 0 PM20
Address: FF23H After reset: FFH Symbol PM3 7 1 6 PM36
R/W 5 PM35 4 PM34 3 PM33 2 PM32 1 PM31 0 PM30
Address: FF24H After reset: FFH Symbol PM4 7 PM47 6 PM46
R/W 5 PM45 4 PM44 3 PM43 2 PM42 1 PM41 0 PM40
Address: FF25H After reset: FFH Symbol PM5 7 PM57 6 PM56
R/W 5 PM55 4 PM54 3 PM53 2 PM52 1 PM51 0 PM50
Address: FF26H After reset: FFH Symbol PM6 7 PM67 6 PM66
R/W 5 PM65 4 PM64 3 1 2 1 1 1 0 1
Address: FF27H After reset: FFH Symbol PM7 7 1 6 1
R/W 5 PM75 4 PM74 3 PM73 2 PM72 1 PM71 0 PM70
Address: FF28H After reset: FFH Symbol PM8 7 1 6 1
R/W 5 1 4 1 3 1 2 1 1 1 0 PM80
PMmn 0 1
Pmn pin I/O mode selection (m = 0, 2 to 8: n = 0 to 7) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
119
CHAPTER 6
PORT FUNCTIONS
Table 6-6. Port Mode Registers and Output Latch Settings When Alternate Function Is Used (1/2)
Pin Name Alternate Function Name P00 to P02 P03 INTP0 to INTP2 INTP3 ADTRG P10 to P17 P20 P21 P22 ANI0 to ANI7 SI1 SO1 SCK1 Input Input Input Input Input Output Input Output P23 P24 P25 P32 P33 P34 RxD0 TxD0 ASCK0 SDA0Note 1 SCL0 SI3 TxD2 P35 SO3 RxD2 P36 SCK3
Note 1
PMxx I/O 1 1 1 1 (fix) 1 0 1 0 1 0 1 0 0 1 0 0 1 1 0 1 x
Note 2
Pxx
x x x x x 0 x 0 x 0 x 0 0 x 0 0 x x 0 x xNote 2 xNote 2 xNote 2
Input Output Input I/O I/O Input Output Output Input Input Output
ASCK2 P40 to P47 P50 to P57 P64 P65 P66 P67 AD0 to AD7 A8 to A15 RD WR WAIT ASTB
Input I/O Output Output Output Input Output 1
Note 2
xNote 2 xNote 2
Notes 1. PD780078Y Subseries only 2. When using the P40 to P47, P50 to P57, and P64 to P67 pins as alternate-function pins, set the function using the memory expansion mode register (MEM). Remark x: Pxx: Don't care Port register (port output latch)
PMxx: Port mode register
120
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
Table 6-6. Port Mode Registers and Output Latch Settings When Alternate Function Is Used (2/2)
Pin Name Alternate Function Name P70 TI000 TO00 P71 P72 TI010 TI50 TO50 P73 TI51 TO51 P74 TI011 PCL P75 TI001 TO01 BUZ P80 SS1 Input Output Input Input Output Input Output Input Output Input Output Output Input I/O 1 0 1 1 0 1 0 1 0 1 0 0 1 x 0 x x 0 x 0 x 0 x 0 0 x PMxx Pxx
Remark x: Pxx:
Don't care Port register (port output latch)
PMxx: Port mode register
User's Manual U14260EJ3V1UD
121
CHAPTER 6
PORT FUNCTIONS
(2) Port registers (P0 to P8) These registers write the data that is output from the chip when data is output from a port. If the data is read in the input mode, the pin level is read. If it is read in the output mode, the value of the output latch is read. P0 to P8 are set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears P0 to P8 to 00H (but P1 is undefined). Figure 6-23. Format of Port Register
Symbol P0 7 0 7 P1 P17 7 P2 0 7 P3 0 7 P4 P47 7 P5 P57 7 P6 P67 7 P7 0 7 P8 0 6 0 6 P16 6 0 6 P36 6 P46 6 P56 6 P66 6 0 6 0 5 0 5 P15 5 P25 5 P35 5 P45 5 P55 5 P65 5 P75 5 0 4 0 4 P14 4 P24 4 P34 4 P44 4 P54 4 P64 4 P74 4 0 3 P03 3 P13 3 P23 3 P33 3 P43 3 P53 3 0 3 P73 3 0 2 P02 2 P12 2 P22 2 P32 2 P42 2 P52 2 0 2 P72 2 0 1 P01 1 P11 1 P21 1 P31 1 P41 1 P51 1 0 1 P71 1 0 0 P00 0 P10 0 P20 0 P30 0 P40 0 P50 0 0 0 P70 0 P80 FF08H 00H (output latch) R/W FF07H 00H (output latch) R/W FF06H 00H (output latch) R/W FF05H 00H (output latch) R/W FF04H 00H (output latch) R/W FF03H 00H (output latch) R/W FF02H 00H (output latch) R/W FF01H Undefined R Address FF00H After reset 00H (output latch) R/W R/W
Pmn
m = 0 to 8; n = 0 to 7 Output data control (in output mode) Input data read (in input mode) Input low level Input high level
0 1
Output 0 Output 1
122
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
(3) Pull-up resistor option registers (PU0, PU2 to PU8) These registers are used to set whether to connect an on-chip pull-up resistor at each port or not. By setting PU0 and PU2 to PU8, the on-chip pull-up resistors of the port pins corresponding to the bits in PU0 and PU2 to PU8 can be connected. PU0 and PU2 to PU8 are set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PU0 and PU2 to PU8 to 00H. Cautions 1. The P10 and P17 pins do not incorporate a pull-up resistor. 2. Pins P30 to P33 (in the PD780078Y Subseries, P30 and P31 pins) can be connected to a pull-up resistor via a mask option only for mask ROM versions. 3. When PUm is set to 1, the on-chip pull-up resistor is connected irrespective of the input/ output mode. When using in output mode, set the bit of PUm to 0 (m = 0, 2 to 8).
User's Manual U14260EJ3V1UD
123
CHAPTER 6
PORT FUNCTIONS
Figure 6-24. Format of Pull-Up Resistor Option Register (PU0, PU2 to PU8)
Address: FF30H After reset: 00H Symbol PU0 7 0 6 0 R/W 5 0 4 0 3 PU03 2 PU02 1 PU01 0 PU00
Address: FF32H After reset: 00H Symbol PU2 7 0 6 0
R/W 5 PU25 4 PU24 3 PU23 2 PU22 1 PU21 0 PU20
Address: FF33H After reset: 00H Symbol PU3 7 0 6 PU36
R/W 5 PU35 4 PU34 3 0 2 0 1 0 0 0
Address: FF34H After reset: 00H Symbol PU4 7 PU47 6 PU46
R/W 5 PU45 4 PU44 3 PU43 2 PU42 1 PU41 0 PU40
Address: FF35H After reset: 00H Symbol PU5 7 PU57 6 PU56
R/W 5 PU55 4 PU54 3 PU53 2 PU52 1 PU51 0 PU50
Address: FF36H After reset: 00H Symbol PU6 7 PU67 6 PU66
R/W 5 PU65 4 PU64 3 0 2 0 1 0 0 0
Address: FF37H After reset: 00H Symbol PU7 7 0 6 0
R/W 5 PU75 4 PU74 3 PU73 2 PU72 1 PU71 0 PU70
Address: FF38H After reset: 00H Symbol PU8 7 0 6 0
R/W 5 0 4 0 3 0 2 0 1 0 0 PU80
PUmn 0 1
Pmn pin on-chip pull-up resistor selection (m = 0, 2 to 8: n = 0 to 7) On-chip pull-up resistor not connected On-chip pull-up resistor connected
124
User's Manual U14260EJ3V1UD
CHAPTER 6
PORT FUNCTIONS
6.4 Port Function Operations
Port operations differ depending on whether the input or output mode is set, as shown below. Caution In the case of 1-bit memory manipulation instruction, although a single bit is manipulated, the port is accessed in 8-bit units. Therefore, on a port with a mixture of input and output pins, the output latch contents for pins specified as input are undefined, even for bits other than the manipulated bit. 6.4.1 Writing to I/O port (1) Output mode A value is written to the output latch by a transfer instruction, and the output latch contents are output from the pin. Once data is written to the output latch, it is retained until data is written to the output latch again. When a reset is input, the data in the output latch is cleared. (2) Input mode A value is written to the output latch by a transfer instruction, but since the output buffer is off, the pin status does not change. Once data is written to the output latch, it is retained until data is written to the output latch again. 6.4.2 Reading from I/O port (1) Output mode The output latch contents are read by a transfer instruction. The output latch contents do not change. (2) Input mode The pin status is read by a transfer instruction. The output latch contents do not change. 6.4.3 Operations on I/O port (1) Output mode An operation is performed on the output latch contents, and the result is written to the output latch. The output latch contents are output from the pins. Once data is written to the output latch, it is retained until data is written to the output latch again. When a reset is input, the data in the output latch is cleared. (2) Input mode The pin level is read and an operation is performed on its contents. The result of the operation is written to the output latch, but since the output buffer is off, the pin status does not change.
User's Manual U14260EJ3V1UD
125
CHAPTER 6
PORT FUNCTIONS
6.5 Selection of Mask Option
The following mask option is provided in the mask ROM versions. The flash memory versions have no mask options. Table 6-7. Comparison Between Mask ROM Version and Flash Memory Version
Pin Name Mask option for pins P30 to P33Note Mask ROM Version On-chip pull-up resistors specifiable in 1-bit units Flash Memory Version Cannot specify an on-chip pull-up resistor
Note For PD780078Y Subseries products, only the P30 and P31 pins can incorporate a pull-up resistor.
126
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.1 Clock Generator Functions
The clock generator generates the clock to be supplied to the CPU and peripheral hardware. The following two system clock oscillators are available. (1) Main system clock oscillator This circuit oscillates a clock with the following frequencies. * 1 to 8.38 MHz: Conventional product of PD780078 Subseries and PD780078Y Subseries * 1 to 12 MHz: Expanded-specification product of PD780078 Subseries
Oscillation can be stopped by executing the STOP instruction or setting the processor clock control register (PCC). (2) Subsystem clock oscillator The circuit oscillates a clock with a frequency of 32.768 kHz. Oscillation cannot be stopped. If the subsystem clock oscillator is not used, the internal feedback resistor can be disabled by the processor clock control register (PCC). This enables a reduction of power consumption in the STOP mode.
7.2 Clock Generator Configuration
The clock generator consists of the following hardware. Table 7-1. Clock Generator Configuration
Item Control registers Configuration Processor clock control register (PCC) Oscillation stabilization time select register (OSTS) Oscillators Main system clock oscillator Subsystem clock oscillator Prescaler Standby controller Wait controller
Controllers
User's Manual U14260EJ3V1UD
127
CHAPTER 7
CLOCK GENERATOR
Figure 7-1. Block Diagram of Clock Generator
Internal bus Oscillation stabilization time select register (OSTS) OSTS2 OSTS1 OSTS0 XT1 XT2 Subsystem clock oscillator fXT
FRC
Prescaler 1/2 X1 X2 Main system clock oscillator fXT 2 3
Watch timer, clock output function
Prescaler fX fX 2 fX 22 fX 23 fX 24
Clock to peripheral hardware
Selector
Standby controller
Wait controller
CPU clock (fCPU)
HALT 3
STOP
MCC FRC
CLS
CSS PCC2 PCC1 PCC0 Processor clock control register (PCC)
Internal bus
128
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.3 Clock Generator Control Registers
The clock generator is controlled by the following two registers. * Processor clock control register (PCC) * Oscillation stabilization time select register (OSTS) (1) Processor clock control register (PCC) PCC selects the CPU clock and the division ratio, sets main system clock oscillator operation/stop and sets whether to use the subsystem clock oscillator internal feedback resistorNote. PCC is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PCC to 04H. Note The feedback resistor is required to control the bias point of the oscillation waveform so that the bias point is in the middle of the power supply voltage. When the subsystem clock is not used, the power consumption in the STOP mode can be reduced by setting bit 6 (FRC) of PCC to 1 (refer to Figure 7-7 Subsystem Clock Feedback Resistor).
User's Manual U14260EJ3V1UD
129
CHAPTER 7
CLOCK GENERATOR
Figure 7-2. Format of Processor Clock Control Register (PCC)
Address: FFFBH After reset: 04H Symbol PCC 7 MCC 6 FRC R/WNote 1 5 CLS 4 CSS 3 0 2 PCC2 1 PCC1 0 PCC0
MCC 0 1 Oscillation possible Oscillation stopped
Main system clock oscillation controlNote 2
FRC 0 1
Subsystem clock feedback resistor selection Internal feedback resistor used Internal feedback resistor not usedNote 3
CLS 0 1 Main system clock Subsystem clock
CPU clock status
CSS 0
PCC2 0 0 0 0 1
PCC1 0 0 1 1 0 0 0 1 1 0
PCC0 0 1 0 1 0 0 1 0 1 0 fX fX/2 fX/22 fX/23 fX/24 fXT/2
CPU clock (fCPU) selection
1
0 0 0 0 1
Other than above
Setting prohibited
Notes 1. Bit 5 is read only. 2. When the CPU is operating on the subsystem clock, MCC should be used to stop the main system clock oscillation. The STOP instruction should not be used. 3. This bit can be set to 1 only when the subsystem clock is not used. Cautions 1. Be sure to set bit 3 to 0. 2. When the external clock is input, MCC should not be set. This is because the X2 pin is connected to VDD1 via a pull-up resistor. Remarks 1. fX: Main system clock oscillation frequency 2. fXT: Subsystem clock oscillation frequency
130
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
The fastest instructions of the PD780078 and 780078Y Subseries are carried out in two CPU clocks. The relationship between the CPU clock (fCPU) and minimum instruction execution time is shown in Table 7-2. Table 7-2. Relationship Between CPU Clock and Minimum Instruction Execution Time
CPU Clock (fCPU) Minimum Instruction Execution Time: 2/fCPU fX = 8.38 MHz fX fX/2 fX/22 fX/23 fX/24 fXT/2 0.238 s 0.477 s 0.954 s 1.90 s 3.81 s - fX = 12 MHzNote 0.166 s 0.333 s 0.666 s 1.33 s 2.66 s - 122 s fXT = 32.768 kHz - - - - -
Note Expanded-specification products of PD780078 Subseries only Remark fX: Main system clock oscillation frequency fXT: Subsystem clock oscillation frequency
User's Manual U14260EJ3V1UD
131
CHAPTER 7
CLOCK GENERATOR
(2) Oscillation stabilization time select register (OSTS) This register is used to select the oscillation stabilization time from when reset is effected or STOP mode is released to when oscillation is stabilized. OSTS is set by an 8-bit memory manipulation instruction. RESET input sets OSTS to 04H. Thus, when releasing the STOP mode by RESET input, the time required to release is 217/fx.
Figure 7-3. Format of Oscillation Stabilization Time Select Register (OSTS)
Address: FFFAH Symbol OSTS 7 0 After reset: 04H 6 0 R/W 5 0 4 0 3 0 2 OSTS2 1 OSTS1 0 OSTS0
OSTS2
OSTS1
OSTS0
Selection of oscillation stabilization time fX = 8.38 MHz fX = 12 MHzNote 341 s 1.36 ms 2.73 ms 5.46 ms 10.9 ms
0 0 0 0 1
0 0 1 1 0
0 1 0 1 0
212/fX 214/fX 215/fX 216/fX 217/fX Setting prohibited
488 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms
Other than above
Note Expanded-specification products of PD780078 Subseries only. Caution The wait time when STOP mode is released does not include the time ("a" in the figure below) from when STOP mode is released until the clock starts oscillation. This also applies when RESET is input and an interrupt request is generated.
STOP mode is released Voltage waveform of X1 pin a
Remark fX: Main system clock oscillation frequency
132
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.4 System Clock Oscillator
7.4.1 Main system clock oscillator The main system clock oscillator oscillates with a crystal resonator or a ceramic resonator (8.38 MHz TYP.) connected to the X1 and X2 pins. External clocks can be input to the main system clock oscillator. In this case, input a clock signal to the X1 pin and an inverted-phase clock signal to the X2 pin. Figure 7-4 shows an external circuit of the main system clock oscillator. Figure 7-4. External Circuit of Main System Clock Oscillator (a) Crystal and ceramic oscillation (b) External clock
X2
X2
X1 VSS1 Crystal resonator or ceramic resonator
External clock
X1
Caution
Do not execute the STOP instruction and do not set MCC (bit 7 of processor clock control register (PCC)) to 1 if an external clock is input. This is because when the STOP instruction is executed or MCC is set to 1, the main system clock operation stops and the X2 pin is connected to VDD1 via a pull-up resistor.
User's Manual U14260EJ3V1UD
133
CHAPTER 7
CLOCK GENERATOR
7.4.2 Subsystem clock oscillator The subsystem clock oscillator oscillates with a crystal resonator (32.768 kHz TYP.) connected to the XT1 and XT2 pins. External clocks can be input to the subsystem clock oscillator. In this case, input a clock signal to the XT1 pin and an inverted-phase clock signal to the XT2 pin. Figure 7-5 shows an external circuit of the subsystem clock oscillator. Figure 7-5. External Circuit of Subsystem Clock Oscillator (a) Crystal oscillation (b) External clock
XT2 32.768 kHz XT1 VSS1 External clock
XT2
XT1
Cautions are listed on the next page.
134
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
Caution
1. When using the main system clock oscillator and subsystem clock oscillator, wire as follows in the area enclosed by broken lines in Figures 7-4 and 7-5 to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with other signal lines. Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. Note that the subsystem clock oscillator is designed as a low-amplitude circuit for reducing power consumption. Figure 7-6 shows examples of incorrect resonator connection. Figure 7-6. Examples of Incorrect Resonator Connection (1/2) (a) Too long wiring (b) Crossed signal line
PORTn (n = 0 to 8)
X2
X1
VSS1
X2
X1
VSS1
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert resistors in series on the XT2 side.
User's Manual U14260EJ3V1UD
135
CHAPTER 7
CLOCK GENERATOR
Figure 7-6. Examples of Incorrect Resonator Connection (2/2) (c) Wiring near high fluctuating current (d) Current flowing through ground line of oscillator (potential at points A, B, and C fluctuates)
VDD0
Pnm X2
High current
X1
VSS1 X2 X1 VSS1
A
B High current
C
(e) Signals are fetched
X2
X1
VSS1
Remark When using the subsystem clock, replace X1 and X2 with XT1 and XT2, respectively. Also, insert resistors in series on the XT2 side. Caution 2. When X2 and XT1 are wired in parallel, the crosstalk noise of X2 may increase with XT1, resulting in malfunction. To prevent that from occurring, it is recommended to wire X2 and XT1 so that they are not in parallel, and to connect the IC pin between X2 and XT1 directly to VSS1.
136
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.4.3 When subsystem clock is not used If it is not necessary to use the subsystem clock for low power consumption operations and watch operations, connect the XT1 and XT2 pins as follows. XT1: Connect directly to VDD0 or VDD1 XT2: Leave open In this state, however, some current may leak via the internal feedback resistor of the subsystem clock oscillator when the main system clock stops. To minimize leakage current, the above internal feedback resistor can be removed by setting bit 6 (FRC) of the processor clock control register (PCC). In this case also, connect the XT1 and XT2 pins as described above. Figure 7-7. Subsystem Clock Feedback Resistor
FRC P-ch Feedback resistor
XT1
XT2
Remark The feedback resistor is required to control the bias point of the oscillation waveform so that the bias point is in the middle of the power supply voltage.
User's Manual U14260EJ3V1UD
137
CHAPTER 7
CLOCK GENERATOR
7.5 Clock Generator Operations
The clock generator generates the following types of clocks and controls the CPU operating mode including the standby mode. * Main system clock * Subsystem clock * CPU clock fCPU fX fXT
* Clock to peripheral hardware The following clock generator functions and operations are determined by the processor clock control register (PCC). (a) Upon generation of the RESET signal, the lowest speed mode of the main system clock (3.81 s @ 8.38 MHz operation) is selected (PCC = 04H). Main system clock oscillation stops while a low level is applied to the RESET pin. (b) With the main system clock selected, one of the five levels of minimum instruction execution time (0.166 s, 0.333
s, 0.666 s, 1.33 s, 2.66 s: @ 12 MHz operationNote, 0.238 s, 0.476 s, 0.954 s, 1.90 s, 3.81 s: @ 8.38
MHz operation) can be selected by setting PCC. (c) With the main system clock selected, two standby modes, the STOP and HALT modes, are available. To reduce power consumption in the STOP mode, the subsystem clock feedback resistor can be disconnected to stop the subsystem clock. (d) PCC can be used to select the subsystem clock and to operate the system with low power consumption (122
s @ 32.768 kHz operation).
(e) With the subsystem clock selected, main system clock oscillation can be stopped via PCC. The HALT mode can be used. However, the STOP mode cannot be used (subsystem clock oscillation cannot be stopped). (f) The main system clock is divided and supplied to the peripheral hardware. The subsystem clock is supplied to the watch timer and clock output functions only. Thus the watch function and the clock output function can also be continued in the standby state. However, since all other peripheral hardware operate with the main system clock, the peripheral hardware also stops if the main system clock is stopped (except external input clock operation). Note Expanded-specification products of PD780078 Subseries only
138
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.5.1 Main system clock operations When operating with the main system clock (with bit 5 (CLS) of the processor clock control register (PCC) set to 0), the following operations are carried out by PCC setting. (a) Because the operation-guaranteed instruction execution speed depends on the power supply voltage, the minimum instruction execution time can be changed by bits 0 to 2 (PCC0 to PCC2) of PCC. (b) When bit 4 (CSS) of PCC is set to 1 when operating with the main system clock, if bit 7 (MCC) of PCC is set to 1 after the operation has been switched to the subsystem clock (CLS = 1), the main system clock oscillation stops (see Figure 7-8 (1)). (c) If bit 7 (MCC) of PCC is set to 1 when operating with the main system clock, the main system clock oscillation does not stop. When bit 4 (CSS) of PCC is set to 1 and the operation is switched to the subsystem clock (CLS = 1) after that, the main system clock oscillation stops (see Figure 7-8 (2)). Figure 7-8. Main System Clock Stop Function (1) Operation when MCC is set after setting CSS with main system clock operation
MCC
CSS
CLS
Main system clock oscillation
Subsystem clock oscillation
CPU clock
(2) Operation when CSS is set after setting MCC with main system clock operation
MCC
CSS
CLS Oscillation does not stop Main system clock oscillation
Subsystem clock oscillation
CPU clock
User's Manual U14260EJ3V1UD
139
CHAPTER 7
CLOCK GENERATOR
7.5.2 Subsystem clock operations When operating with the subsystem clock (with bit 5 (CLS) of the processor clock control register (PCC) set to 1), the following operations are carried out. (a) The minimum instruction execution time remains constant (122 s @ 32.768 kHz operation) irrespective of bits 0 to 2 (PCC0 to PCC2) of PCC. (b) Watchdog timer counting stops. Caution Do not execute the STOP instruction while the subsystem clock is in operation.
7.6 Changing System Clock and CPU Clock Settings
7.6.1 Time required for switchover between system clock and CPU clock The system clock and CPU clock can be switched over by means of bits 0 to 2 (PCC0 to PCC2) and bit 4 (CSS) of the processor clock control register (PCC). The actual switchover operation is not performed directly after writing to the PCC; operation continues on the preswitchover clock for several instructions (see Table 7-3). Determination as to whether the system is operating on the main system clock or the subsystem clock is performed by bit 5 (CLS) of the PCC register. Table 7-3. Maximum Time Required for CPU Clock Switchover
Set Value Before Switchover
Set Value After Switchover
CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 CSS PCC2 PCC1 PCC0 0 0 0 0 0 0 1 1 x 0 0 1 1 0 x 0 1 0 1 0 x 8 instructions 4 instructions 2 instructions 1 instruction 1 instruction 4 instructions 2 instructions 1 instruction 1 instruction 2 instructions 1 instruction 1 instruction 1 instruction 1 instruction 1 instruction 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 x x x
16 instructions
16 instructions 8 instructions
16 instructions 8 instructions 4 instructions
16 instructions 8 instructions 4 instructions 2 instructions
fX/2fXT instruction fX/4fXT instruction fX/8fXT instruction fX/16fXT instruction fX/32fXT instruction
Remark One instruction is the minimum instruction execution time with the pre-switchover CPU clock. Caution Selection of the CPU clock cycle division ratio (PCC0 to PCC2) and switchover from the main system clock to the subsystem clock (changing CSS from 0 to 1) should not be set simultaneously. Simultaneous setting is possible, however, for selection of the CPU clock cycle division ratio (PCC0 to PCC2) and switchover from the subsystem clock to the main system clock (changing CSS from 1 to 0).
140
User's Manual U14260EJ3V1UD
CHAPTER 7
CLOCK GENERATOR
7.6.2 System clock and CPU clock switching procedure This section describes procedure for switching between the system clock and CPU clock. Figure 7-9. System Clock and CPU Clock Switching
VDD
RESET
Interrupt request signal
System clock CPU clock
fX Lowestspeed operation
fX Highestspeed operation
fXT Subsystem clock operation
fX High-speed operation
Wait (15.6 ms: @8.38 MHz operation) Internal reset operation
<1> The CPU is reset by setting the RESET signal to low level after power-on. After that, when reset is released by setting the RESET signal to high level, the main system clock starts oscillation. At this time, the oscillation stabilization time (217/fX) is secured automatically. After that, the CPU starts executing instructions at the minimum speed of the main system clock (3.81 s @ 8.38 MHz operation). <2> After the lapse of sufficient time for the VDD voltage to increase to enable operation at maximum speeds, PCC is rewritten and maximum-speed operation is carried out. <3> Upon detection of a decrease of the VDD voltage due to an interrupt request signal, the main system clock is switched to the subsystem clock (which must be in an oscillation stable state). <4> Upon detection of VDD voltage reset due to an interrupt, 0 is set to the MCC and oscillation of the main system clock is started. After the lapse of the time required for stabilization of oscillation, PCC is rewritten and the maximum-speed operation is resumed. Caution When the main system clock is stopped and the device is operating on the subsystem clock, wait until the oscillation stabilization time has been secured by the program before switching back to the main system clock.
User's Manual U14260EJ3V1UD
141
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.1 Functions of 16-Bit Timer/Event Counters 00, 01
16-bit timer/event counters 00, 01 have the following functions. (1) Interval timer 16-bit timer/event counters 00, 01 generate interrupt requests at the preset time interval. * Number of counts: 2 to 65536 (2) External event counter 16-bit timer/event counters 00, 01 can measure the number of pulses with a high-/low-level width of a signal input externally. * Valid level pulse width: 16/fX or more (3) Pulse width measurement 16-bit timer/event counters 00, 01 can measure the pulse width of an externally input signal. * Valid level pulse width: 2/fX or more (4) Square-wave output 16-bit timer/event counters 00, 01 can output a square wave with any selected frequency. * Cycle: (2 x 2 to 65536 x 2) x count clock cycle (5) PPG output 16-bit timer/event counters 00, 01 can output a square wave that have arbitrary cycle and pulse width. * 2 < Pulse width < Cycle (FFFF + 1) H
142
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.2 Configuration of 16-Bit Timer/Event Counters 00, 01
16-bit timer/event counters 00, 01 consist of the following hardware. Table 8-1. Configuration of 16-Bit Timer/Event Counters 00, 01
Item Timer counter Register Timer input Timer output Control registers Configuration 16-bit timer counter 0n (TM0n) 16-bit timer capture/compare registers 00n, 01n (CR00n, CR01n) TI00n, TI01n TO0n, output controller 16-bit timer mode control register 0n (TMC0n) Capture/compare control register 0n (CRC0n) 16-bit timer output control register 0n (TOC0n) Prescaler mode register 0n (PRM0n) Port mode register 7 (PM7) Port register 7 (P7)
Remark n = 0, 1 Figures 8-1 and 8-2 show the block diagrams. Figure 8-1. Block Diagram of 16-Bit Timer/Event Counter 00
Internal bus Capture/compare control register 00 (CRC00)
CRC020 CRC010 CRC000
Selector
INTTM000
TI010/P71
Noise eliminator
Selector
16-bit timer capture/compare register 000 (CR000) Match
Selector
fX fX/22 fX/26
16-bit timer counter 00 (TM00) Match
Clear
Output controller Output latch (P70)
PM70
TO00/TI000/ P70Note
fX/23
Noise eliminator
2
TI000/TO00/P70Note
Noise eliminator
16-bit timer capture/compare register 010 (CR010)
Selector
INTTM010
CRC020 PRM010 PRM000
Prescaler mode register 00 (PRM00)
TMC003 TMC002 OVF00 TOC040 LVS00 LVR00 TOC010 TOE00 16-bit timer mode 16-bit timer output control register 00 control register 00 (TMC00) (TOC00)
Internal bus
Note TI000 input and TO00 output cannot be used at the same time.
User's Manual U14260EJ3V1UD
143
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-2. Block Diagram of 16-Bit Timer/Event Counter 01
Internal bus Capture/compare control register 01 (CRC01)
CRC021 CRC011 CRC001
Selector
INTTM001
TI011/PCL/P74
Noise eliminator
Selector
16-bit timer capture/compare register 001 (CR001) Match
Selector
fX/2 fX/23 fX/29
16-bit timer counter 01 (TM01) Match
Clear
TO01/TI001/ BUZ/P75Note
Output controller Output latch (P75)
PM75
fX/23 TI001/TO01/ BUZ/P75Note
Noise eliminator
2
Noise eliminator
16-bit timer capture/compare register 011 (CR011)
Selector
INTTM011
CRC021 PRM011 PRM001
Prescaler mode register 01 (PRM01)
TMC013 TMC012 OVF01 TOC041 LVS01 LVR01 TOC011 TOE01 16-bit timer mode 16-bit timer output control register 01 control register 01 (TMC01) (TOC01)
Internal bus
Note TI001 input and TO01 output cannot be used at the same time.
144
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(1) 16-bit timer counter 0n (TM0n) TM0n is a 16-bit read-only register that counts count pulses. The counter is incremented in synchronization with the rising edge of the count clock. If the count value is read during operation, input of the count clock is temporarily stopped, and the count value at that point is read. Figure 8-3. Format of 16-Bit Timer Counter 0n (TM0n)
Address: FF0EH, FF0FH (TM00), FF6CH, FF6DH (TM01) Symbol FF0FH (TM00) FF6DH (TM01) After reset: 0000H R
FF0EH (TM00) FF6CH (TM01)
TM0n (n = 0, 1)
The count value is reset to 0000H in the following cases. <1> At RESET input <2> If TMC0n3 and TMC0n2 are cleared <3> If the valid edge of TI00n is input in the clear & start mode entered by inputting the valid edge of TI00n <4> If TM0n and CR00n match in the clear & start mode entered on a match between TM0n and CR00n (2) 16-bit timer capture/compare register 00n (CR00n) CR00n is a 16-bit register which has the functions of both a capture register and a compare register. Whether it is used as a capture register or as a compare register is set by bit 0 (CRC00n) of capture/compare control register 0n (CRC0n). CR00n is set by a 16-bit memory manipulation instruction. RESET input clears CR00n to 0000H. Figure 8-4. Format of 16-Bit Timer Capture/Compare Register 00n (CR00n)
Address: FF0AH, FF0BH (CR000), FF68H, FF69H (CR001) Symbol FF0BH (CR000) FF69H (CR001) After reset: 0000H R/W
FF0AH (CR000) FF68H (CR001)
CR00n (n = 0, 1)
* When CR00n is used as a compare register The value set in CR00n is constantly compared with the 16-bit timer/counter 0n (TM0n) count value, and an interrupt request (INTTM00n) is generated if they match. It can also be used as the register that holds the interval time when TM0n is set to interval timer operation. * When CR00n is used as a capture register It is possible to select the valid edge of the TI00n pin or the TI01n pin as the capture trigger. Setting of the TI00n or TI01n valid edge is performed by means of prescaler mode register 0n (PRM0n) (refer to Table 8-2).
User's Manual U14260EJ3V1UD
145
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Table 8-2. CR00n Capture Trigger and Valid Edges of TI00n and TI01n Pins (1) TI00n pin valid edge selected as capture trigger (CRC01n = 1, CRC00n = 1)
CR00n Capture Trigger TI00n Pin Valid Edge ES01n Falling edge Rising edge No capture operation Rising edge Falling edge Both rising and falling edges 0 0 1 ES00n 1 0 1
(2) TI01n pin valid edge selected as capture trigger (CRC01n = 0, CRC00n = 1)
CR00n Capture Trigger TI01n Pin Valid Edge ES11n Falling edge Rising edge Both rising and falling edges Falling edge Rising edge Both rising and falling edges 0 0 1 ES10n 0 1 1
Remarks 1. Setting ES01n, ES00n = 1, 0 and ES11n, ES10n = 1, 0 is prohibited. 2. ES01n, ES00n: ES11n, ES10n: 3. n = 0, 1 Cautions 1. Set CR00n to a value other than 0000H in the clear & start mode entered on a match between TM0n and CR00n. However, in the free-running mode and in the clear & start mode using the valid edge of the TI00n pin, if CR00n is set to 0000H, an interrupt request (INTTM00n) is generated when CR00n changes from 0000H to 0001H following overflow (FFFFH). 2. If the new value of CR00n is less than the value of 16-bit timer counter 0n (TM0n), TM0n continues counting, overflows, and then starts counting from 0 again. If the new value of CR00n is less than the old value, therefore, the timer must be reset to be restarted after the value of CR00n is changed. 3. When P70 is used as the input pin for the valid edge of TI000, it cannot be used as a timer output (TO00). Moreover, when P70 is used as TO00, it cannot be used as the input pin for the valid edge of TI000. 4. When P75 is used as the input pin for the valid edge of TI001, it cannot be used as a timer output (TO01). Moreover, when P75 is used as TO01, it cannot be used as the input pin for the valid edge of TI001. 5. When CR00n is used as a capture register, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). If count stop input and capture trigger input conflict, the captured data is undefined. Bits 5 and 4 of prescaler mode register 0n (PRM0n) Bits 7 and 6 of prescaler mode register 0n (PRM0n)
CRC01n, CRC00n: Bits 1 and 0 of capture/compare control register 0n (CRC0n)
146
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(3) 16-bit timer capture/compare register 01n (CR01n) CR01n is a 16-bit register which has the functions of both a capture register and a compare register. Whether it is used as a capture register or a compare register is set by bit 2 (CRC02n) of capture/compare control register 0n (CRC0n). CR01n is set by a 16-bit memory manipulation instruction. RESET input clears CR01n to 0000H. Figure 8-5. Format of 16-Bit Timer Capture/Compare Register 01n (CR01n)
Address: FF0CH, FF0DH (CR010), FF6AH, FF6BH (CR011) Symbol FF0DH (CR010) FF6BH (CR011) After reset: 0000H FF0CH (CR010) FF6AH (CR011) R/W
CR01n (n = 0, 1)
* When CR01n is used as a compare register The value set in CR01n is constantly compared with the 16-bit timer counter 0n (TM0n) count value, and an interrupt request (INTTM01n) is generated if they match. * When CR01n is used as a capture register It is possible to select the valid edge of the TI00n pin as the capture trigger. The TI00n valid edge is set by means of prescaler mode register 0n (PRM0n) (refer to Table 8-3). Table 8-3. CR01n Capture Trigger and Valid Edge of TI00n Pin (CRC02n = 1)
CR01n Capture Trigger TI00n Pin Valid Edge ES01n Falling edge Rising edge Both rising and falling edges Falling edge Rising edge Both rising and falling edges 0 0 1 ES00n 0 1 1
Remarks 1. Setting ES01n, ES00n = 1, 0 is prohibited. 2. ES01n, ES00n: Bits 5 and 4 of prescaler mode register 0n (PRM0n) CRC02n: 3. n = 0, 1 Cautions 1. If CR01n is set to 0000H, an interrupt request (INTTM01n) is generated when CR01n changes from 0000H to 0001H following overflow (FFFFH). INTTM01n is generated after the match between TM0n and CR01n or after the valid edge of the TI00n pin is detected. 2. When CR01n is used as a capture register, read data is undefined if the register read time and capture trigger input conflict (the capture data itself is the correct value). If count stop input and capture trigger input conflict, the captured data is undefined. Remark n = 0, 1 Bit 2 of capture/compare control register 0n (CRC0n)
User's Manual U14260EJ3V1UD
147
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.3 Registers to Control 16-Bit Timer/Event Counters 00, 01
The following six types of registers are used to control 16-bit timer/event counters 00, 01. * 16-bit timer mode control register 0n (TMC0n) * Capture/compare control register 0n (CRC0n) * 16-bit timer output control register 0n (TOC0n) * Prescaler mode register 0n (PRM0n) * Port mode register 7 (PM7) * Port register 7 (P7) Remark n = 0, 1 (1) 16-bit timer mode control register 0n (TMC0n: n = 0, 1) This register sets the 16-bit timer operating mode, the 16-bit timer counter 0n (TM0n) clear mode, and output timing, and detects an overflow. TMC0n is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears TMC0n to 00H. Caution 16-bit timer counter 0n (TM0n) starts operation at the moment TMC0n2 and TMC0n3 (operation stop mode) are set to a value other than 0, 0, respectively. Set TMC0n2 and TMC0n3 to 0, 0 to stop the operation.
148
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-6. Format of 16-Bit Timer Mode Control Register 00 (TMC00)
Address: FF60H Symbol TMC00 7 0 After reset: 00H 6 0 5 0 R/W 4 0 3 2 1 0 0 OVF00
TMC003 TMC002
TMC003 TMC002 0 0
Operating mode and clear mode selection Operation stop (TM00 cleared to 0)
TO00 inversion timing selection No change
Interrupt request generation Not generated
0
1
Free-running mode
Match between TM00 and CR000 or match between TM00 and CR010 --
1
0
Clear & start on TI000 pin valid edge
Generated on match between TM00 and CR000, or match between TM00 and CR010
1
1
Clear & start on match between TM00 and CR000
Match between TM00 and CR000 or match between TM00 and CR010
OVF00 0 1 Overflow not detected Overflow detected
Overflow detection of 16-bit timer counter 00 (TM00)
Cautions 1. To write different data to TMC00, stop the timer operation before writing. 2. The timer operation must be stopped before writing to bits other than the OVF00 flag. 3. Set the valid edge of the TI000/TO00/P70 pin with prescaler mode register 00 (PRM00). 4. If any of the following modes is selected: the mode in which clear & start occurs on match between TM00 and CR000, the mode in which clear & start occurs at the TI000 pin valid edge, or free-running mode, when the set value of CR000 is FFFFH and the TM00 value changes from FFFFH to 0000H, the OVF00 flag is set to 1. Remarks 1. TO00: 16-bit timer/event counter 00 output pin 2. TI000: 16-bit timer/event counter 00 input pin 3. TM00: 16-bit timer counter 00 4. CR000: 16-bit timer capture/compare register 000 5. CR010: 16-bit timer capture/compare register 010
User's Manual U14260EJ3V1UD
149
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-7. Format of 16-Bit Timer Mode Control Register 01 (TMC01)
Address: FF64H Symbol TMC01 7 0 After reset: 00H 6 0 5 0 R/W 4 0 3 2 1 0 0 OVF01
TMC013 TMC012
TMC013 TMC012 0 0
Operating mode and clear mode selection Operation stop (TM01 cleared to 0)
TO01 output timing selection No change
Interrupt request generation Not generated
0
1
Free-running mode
Match between TM01 and CR001 or match between TM01 and CR011 --
1
0
Clear & start on TI001 pin valid edge
Generated on match between TM01 and CR001, or match between TM01 and CR011
1
1
Clear & start on match between TM01 and CR001
Match between TM01 and CR001 or match between TM01 and CR011
OVF01 0 1
Overflow detection of 16-bit timer counter 01 (TM01) Overflow not detected Overflow detected
Cautions 1. To write different data to TMC01, stop the timer operation before writing. 2. The timer operation must be stopped before writing to bits other than the OVF01 flag. 3. Set the valid edge of the TI001/TO01/BUZ/P75 pin with prescaler mode register 01 (PRM01). 4. If any of the following modes is selected: the mode in which clear & start occurs on match between TM01 and CR001, the mode in which clear & start occurs at the TI001 pin valid edge, or free-running mode, when the set value of CR001 is FFFFH and the TM01 value changes from FFFFH to 0000H, the OVF01 flag is set to 1. Remarks 1. TO01: 16-bit timer/event counter 01 output pin 2. TI001: 16-bit timer/event counter 01 input pin 3. TM01: 16-bit timer counter 01 4. CR001: 16-bit timer capture/compare register 001 5. CR011: 16-bit timer capture/compare register 011
150
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(2) Capture/compare control register 0n (CRC0n: n = 0, 1) This register controls the operation of the 16-bit timer capture/compare registers (CR00n, CR01n). CRC0n is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CRC0n to 00H. Figure 8-8. Format of Capture/Compare Control Register 00 (CRC00)
Address: FF62H Symbol CRC00 7 0 After reset: 00H 6 0 R/W 5 0 4 0 3 0 2 CRC020 1 CRC010 0 CRC000
CRC020 0 1
CR010 operating mode selection Operate as compare register Operate as capture register
CRC010 0 1
CR000 capture trigger selection Capture on valid edge of TI010 pin Capture on valid edge of TI000 pin by reverse phase
CRC000 0 1
CR000 operating mode selection Operate as compare register Operate as capture register
Cautions 1. The timer operation must be stopped before setting CRC00. 2. When the clear & start mode entered on a match between TM00 and CR000 is selected by 16-bit timer mode control register 00 (TMC00), CR000 should not be specified as a capture register. 3. If both the rising and falling edges have been selected as the valid edges of the TI000 pin, capture is not performed. 4. To ensure the reliability of the capture operation, the capture trigger requires a pulse longer than two cycles of the count clock selected by prescaler mode register 00 (PRM00) (refer to Figure 8-22).
User's Manual U14260EJ3V1UD
151
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-9. Format of Capture/Compare Control Register 01 (CRC01)
Address: FF66H Symbol CRC01 7 0 After reset: 00H 6 0 R/W 5 0 4 0 3 0 2 CRC021 1 CRC011 0 CRC001
CRC021 0 1
CR011 operating mode selection Operate as compare register Operate as capture register
CRC011 0 1
CR001 capture trigger selection Capture on valid edge of TI011 pin Capture on valid edge of TI001 pin by reverse phase
CRC001 0 1
CR001 operating mode selection Operate as compare register Operate as capture register
Cautions 1. The timer operation must be stopped before setting CRC01. 2. When the clear & start mode entered on a match between TM01 and CR001 is selected by 16-bit timer mode control register 01 (TMC01), CR001 should not be specified as a capture register. 3. If both the rising and falling edges have been selected as the valid edges of the TI001 pin, capture is not performed. 4. To ensure the reliability of the capture operation, the capture trigger requires a pulse longer than two cycles of the count clock selected by prescaler mode register 01 (PRM01) (refer to Figure 8-22).
152
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(3) 16-bit timer output control register 0n (TOC0n: n = 0, 1) This register controls the operation of the 16-bit timer/event counter output controller. It sets timer output F/F set/ reset, output inversion enable/disable, and 16-bit timer/event counter 0n timer output enable/disable. TOC0n is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears TOC0n to 00H. Figure 8-10. Format of 16-Bit Timer Output Control Register 00 (TOC00)
Address: FF63H Symbol TOC00 7 0 After reset: 00H 6 0 R/W 5 0 4 TOC040 3 LVS00 2 LVR00 1 TOC010 0 TOE00
TOC040 0 1
Timer output F/F control by match of CR010 and TM00 Inversion operation disabled Inversion operation enabled
LVS00 0 0 1 1
LVR00 0 1 0 1
16-bit timer/event counter 00 timer output F/F status setting No change Timer output F/F reset (0) Timer output F/F set (1) Setting prohibited
TOC010 0 1
Timer output F/F control by match of CR000 and TM00 Inversion operation disabled Inversion operation enabled
TOE00 0 1
16-bit timer/event counter 00 output control Output disabled (output set to level 0) Output enabled
Cautions 1. The timer operation must be stopped before setting other than TOC040. 2. If LVS00 and LVR00 are read after data is set, they will be 0. 3. Bits 5 to 7 of TOC00 must be set to 0.
User's Manual U14260EJ3V1UD
153
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-11. Format of 16-Bit Timer Output Control Register 01 (TOC01)
Address: FF67H Symbol TOC01 7 0 After reset: 00H 6 0 R/W 5 0 4 TOC041 3 LVS01 2 LVR01 1 TOC011 0 TOE01
TOC041 0 1
Timer output F/F control by match of CR011 and TM01 Inversion operation disabled Inversion operation enabled
LVS01 0 0 1 1
LVR01 0 1 0 1
16-bit timer/event counter 01 timer output F/F status setting No change Timer output F/F reset (0) Timer output F/F set (1) Setting prohibited
TOC011 0 1
Timer output F/F control by match of CR001 and TM01 Inversion operation disabled Inversion operation enabled
TOE01 0 1
16-bit timer/event counter 01 output control Output disabled (output set to level 0) Output enabled
Cautions 1. The timer operation must be stopped before setting TOC041. 2. If LVS01 and LVR01 are read after data is set, they will be 0. 3. Bits 5 to 7 of TOC01 must be set to 0.
154
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(4) Prescaler mode register 0n (PRM0n: n = 0, 1) This register is used to set the 16-bit timer counter 0n (TM0n) count clock and TI00n, TI01n pin input valid edges. PRM0n is set by an 8-bit memory manipulation instruction. RESET input clears PRM0n to 00H. Figure 8-12. Format of Prescaler Mode Register 00 (PRM00)
Address: FF61H Symbol PRM00 7 ES110 After reset: 00H 6 ES100 R/W 5 ES010 4 ES000 3 0 2 0 1 PRM010 0 PRM000
ES110 0 0 1 1
ES100 0 1 0 1 Falling edge Rising edge Setting prohibited
TI010 pin valid edge selection
Both falling and rising edges
ES010 0 0 1 1
ES000 0 1 0 1 Falling edge Rising edge Setting prohibited
TI000 pin valid edge selection
Both falling and rising edges
PRM010
PRM000
Count clock selection fX = 8.38 MHz fX = 12 MHzNote 1 12 MHz 3 MHz 187 kHz
0 0 1 1
0 1 0 1
fX fX/22 fX/26
8.38 MHz 2.09 MHz 130 kHz
TI000 pin valid edgeNotes 2, 3
Notes 1. Expanded-specification products of PD780078 Subseries only. 2. The external clock requires a pulse two cycles longer than internal clock (fX/23). 3. When the valid edge of the TI000 pin is selected, the main system clock is used as the sampling clock for noise elimination. The valid edge of the TI000 pin can be used only when the main system clock is operating. Cautions 1. Always set data to PRM00 after stopping the timer operation. 2. If the valid edge of the TI000 pin is to be set as the count clock, do not set the clear & start mode and the capture trigger at the valid edge of the TI000 pin. 3. When P70 is used as the valid edge of the TI000 pin, it cannot be used as the timer output (TO00 pin), and when used as the TO00 pin, it cannot be used as the valid edge of the TI000 pin. 4. If the TI000 or TI010 pin is high level immediately after system reset, the rising edge is immediately detected after the rising edge or both the rising and falling edges are set as the valid edge(s) of the TI000 pin or TI010 pin to enable the operation of 16-bit timer counter 00 (TM00). Be careful when pulling up the TI000 pin or the TI010 pin. However, when reenabling operation after the operation has been stopped once, the rising edge is not detected. Remarks 1. fX: Main system clock oscillation frequency 2. TI000 or TI010 pin: 16-bit timer/event counter 00 input pin
User's Manual U14260EJ3V1UD
155
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-13. Format of Prescaler Mode Register 01 (PRM01)
Address: FF65H Symbol PRM01 7 ES111 After reset: 00H 6 ES101 R/W 5 ES011 4 ES001 3 0 2 0 1 PRM011 0 PRM001
ES111 0 0 1 1
ES101 0 1 0 1 Falling edge Rising edge Setting prohibited
TI011 pin valid edge selection
Both falling and rising edges
ES011 0 0 1 1
ES001 0 1 0 1 Falling edge Rising edge Setting prohibited
TI001 pin valid edge selection
Both falling and rising edges
PRM011
PRM001
Count clock selection fX = 8.38 MHz fX = 12 MHzNote 1 6 MHz 1.5 MHz 23.43 kHz
0 0 1 1
0 1 0 1
fX/2 fX/23 fX/29 TI001 pin valid
4.19 MHz 1.04 MHz 16.36 kHz edgeNotes 2, 3
Notes 1. Expanded-specification products of PD780078 Subseries only. 2. The external clock requires a pulse two cycles longer than internal clock (fX/23). 3. When the valid edge of the TI001 pin is selected, the main system clock is used as the sampling clock for noise elimination. The valid edge of the TI001 pin can be used only when the main system clock is operating. Cautions 1. Always set data to PRM01 after stopping the timer operation. 2. If the valid edge of the TI001 pin is to be set as the count clock, do not set the clear & start mode and the capture trigger at the valid edge of the TI001 pin. 3. When P75 is used as the valid edge of the TI001 pin, it cannot be used as the timer output (TO01 pin), and when used as the TO01 pin, it cannot be used as the valid edge of the TI001 pin. 4. If the TI001 or TI011 pin is high level immediately after system reset, the rising edge is immediately detected after the rising edge or both the rising and falling edge are set as the valid edge(s) of the TI001 pin or TI011 pin to enable the operation of 16-bit timer counter 01 (TM01). Be careful when pulling up the TI001 pin or the TI011 pin. However, when reenabling operation after the operation has been stopped once, the rising edge is not detected. Remarks 1. fX: Main system clock oscillation frequency 2. TI001 or TI011 pin: 16-bit timer/event counter 01 input pin
156
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(5) Port mode register 7 (PM7) This register sets port 7 input/output in 1-bit units. When using the P70/TO00/TI000 and P75/TO01/TI001/BUZ pins for timer output, set PM70 and PM75, and the output latches of P70 and P75 to 0. When using the P70/TO00/TI000 and P75/TO01/TI001/BUZ pins for timer input, set PM70 and PM75 to 1. At this time, the output latches of P70 and P75 can be either 0 or 1. PM7 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM7 to FFH. Figure 8-14. Format of Port Mode Register 7 (PM7)
Address: FF27H Symbol PM7 7 1 6 1 After reset: FFH 5 4 R/W 3 2 1 0
PM75 PM74 PM73 PM72 PM71 PM70
PM7n 0 1
P7n pin I/O mode selection (n = 0 to 5) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
157
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.4 Operation of 16-Bit Timer/Event Counters 00, 01
8.4.1 Interval timer operation Setting 16-bit timer mode control register 0n (TMC0n) and capture/compare control register 0n (CRC0n) as shown in Figure 8-15 allows operation as an interval timer. Setting The basic operation setting procedure is as follows. <1> Set the CRC0n register (see Figure 8-15 for the set value). <2> Set any value to the CR00n register. <3> Set the count clock by using the PRM0n register. <4> Set the TMC0n register to start the operation (see Figure 8-15 for the set value). Remark For how to enable the INTTM00n interrupt, see CHAPTER 19 INTERRUPT FUNCTIONS. Interrupt requests are generated repeatedly using the count value set in 16-bit timer capture/compare register 00n (CR00n) beforehand as the interval. When the count value of 16-bit timer counter 0n (TM0n) matches the value set to CR00n, counting continues with the TM0n value cleared to 0 and the interrupt request signal (INTTM00n) is generated. The count clock of the 16-bit timer/event counter can be selected using bits 0 and 1 (PRM00n, PRM01n) of prescaler mode register 0n (PRM0n). Figure 8-15. Control Register Settings for Interval Timer Operation (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 1 1 1 0 OVFn0 0 Clears and starts on match between TM0n and CR00n.
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 0/1 0/1 0 CR00n used as compare register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0/1 0/1 3 0 2 0 PRM01n PRM00n 0/1 0/1 Selects count clock. Setting invalid (setting "10" is prohibited.) Setting invalid (setting "10" is prohibited.)
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the interval timer. See the description of the respective control registers for details. n = 0, 1
158
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-16. Interval Timer Configuration Diagram
16-bit timer capture/compare register 00n
INTTM00n fX (fX/2)
2 Note 1
fX/2 (fX/23)Note 1 fX/26 (fX/29)Note 1 TI000/TO00/P70 (TI001/TO01/BUZ/P75)Note 1 Noise eliminator
3
Selector
16-bit timer counter 0n
OVF0nNote 2
Clear circuit
fX/2
Notes 1. The values outside parentheses apply to 16-bit timer/event counter 00, and the values in parentheses apply to 16-bit timer/event counter 01. 2. OVF0n is 1 only when 16-bit timer capture/compare register 00n is set to FFFFH. Figure 8-17. Timing of Interval Timer Operation
t
Count clock TM0n count value 0000H 0001H N 0000H 0001H Clear N N 0000H 0001H Clear N N N
Timer operation enabled CR00n INTTM00n N
Interrupt acknowledged
Interrupt acknowledged
Remarks 1. Interval time = (N + 1) x t N = 0001H to FFFFH 2. n = 0, 1
User's Manual U14260EJ3V1UD
159
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
When the compare register is changed during timer count operation, if the value after 16-bit timer capture/ compare register 00n (CR00n) is changed is smaller than that of 16-bit timer counter 0n (TM0n), TM0n continues counting, overflows and then restarts counting from 0. Thus, if the value (M) after the CR00n change is smaller than that (N) before the change, it is necessary to restart the timer after changing CR00n. Figure 8-18. Timing After Change of Compare Register During Timer Count Operation
Count clock
CR00n
N
M
TM0n count value
X-1
X
FFFFH
0000H
0001H
0002H
Remark N > X > M n = 0, 1
160
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.4.2 External event counter operation Setting The basic operation setting procedure is as follows. <1> Set the CRC0n register (see Figure 8-19 for the set value). <2> Set the count clock by using the PRM0n register. <3> Set any value to the CR00n register (0000H cannot be set). <4> Set the TMC0n register to start the operation (see Figure 8-19 for the set value). Remarks 1. For the setting of the TI00n pin, see 8.3 (5) Port mode register 7 (PM7). 2. For how to enable the INTTM00n interrupt, see CHAPTER 19 INTERRUPT FUNCTIONS. The external event counter counts the number of external clock pulses to be input to the TI00n pin with using 16bit timer counter 0n (TM0n). TM0n is incremented each time the valid edge specified by prescaler mode register 0n (PRM0n) is input. When the TM0n count value matches the 16-bit timer capture/compare register 00n (CR00n) value, TM0n is cleared to 0 and the interrupt request signal (INTTM00n) is generated. Input a value other than 0000H to CR00n (a count operation with a pulse cannot be carried out). The rising edge, the falling edge, or both edges can be selected using bits 4 and 5 (ES00n and ES01n) of prescaler mode register 0n (PRM0n). Because an operation is carried out only when the valid level of the TI00n pin is detected twice after sampling with the internal clock (fX/23), noise with a short pulse width can be eliminated. Caution When used as an external event counter, the P70/TI000/TO00 or P75/TI001/TO01/BUZ pin cannot be used as a timer output (TO00, TO01).
Figure 8-19. Control Register Settings in External Event Counter Mode (with Rising Edge Specified) (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 1 1 1 0 OVF0n 0 Clears and starts on match between TM0n and CR00n.
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 0/1 0/1 0 CR00n used as compare register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0 1 3 0 2 0 PRM01n PRM00n 1 1 Selects external clock. Specifies rising edge for pulse width detection. Setting invalid (setting "10" is prohibited.)
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with the external event counter. See the description of the respective control registers for details. n = 0, 1
User's Manual U14260EJ3V1UD
161
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-20. External Event Counter Configuration Diagram
Internal bus
16-bit timer capture/compare register 00n Match INTTM00n Clear fX/23 Noise eliminator OVF0nNote
16-bit timer counter 0n (TM0n)
Valid edge of TI00n
Note OVF0n is 1 only when 16-bit timer capture/compare register 00n is set to FFFFH. Figure 8-21. External Event Counter Operation Timing (with Rising Edge Specified)
TI00n pin input TM0n count value CR00n INTTM00n 0000H 0001H 0002H 0003H 0004H 0005H N N-1 N 0000H 0001H 0002H 0003H
Caution
When reading the external event counter count value, TM0n should be read.
Remark n = 0, 1
162
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.4.3 Pulse width measurement operations It is possible to measure the pulse width of the signals input to the TI00n pin and TI01n pin using 16-bit timer counter 0n (TM0n). There are two measurement methods: measuring with TM0n used in free-running mode, and measuring by restarting the timer in synchronization with the edge of the signal input to the TI00n pin. When an interrupt occurs, read the valid value of the capture register, check the overflow flag, and then calculate the necessary pulse width. Clear the overflow flag after checking it. The capture operation is not performed until the signal pulse width is sampled in the count clock cycle selected by prescaler mode register 0n (PRM0n) and the valid level of the TI00n or TI01n pin is detected twice, thus eliminating noise with a short pulse width. Figure 8-22. CR01n Capture Operation with Rising Edge Specified
Count clock TM0n TI00n Rising edge detection CR01n INTTM01n N N-3 N-2 N-1 N N+1
Setting The basic operation setting procedure is as follows. <1> Set the CRC0n register (see Figures 8-23, 8-26, 8-28, and 8-30 for the set value). <2> Set the count clock by using the PRM0n register. <3> Set the TMC0n register to start the operation (see Figures 8-23, 8-26, 8-28, and 8-30 for the set value). Caution To use two capture registers, set the TI00n and TI01n pins.
Remarks 1. For the setting of the TI00n (or TI01n) pin, see 8.3 (5) Port mode register 7 (PM7). 2. For how to enable the INTTM00n (or INTTM01n) interrupt, see CHAPTER 19 FUNCTIONS. 3. n = 0, 1 INTERRUPT
User's Manual U14260EJ3V1UD
163
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(1) Pulse width measurement with free-running counter and one capture register When 16-bit timer counter 0n (TM0n) is operated in free-running mode, and the edge specified by prescaler mode register 0n (PRM0n) is input to the TI00n pin, the value of TM0n is taken into 16-bit timer capture/compare register 01n (CR01n) and an external interrupt request signal (INTTM01n) is set. The both falling and rising edges can be specified by bits 4 and 5 (ES00n and ES01n) of PRM0n. Sampling is performed with the count clock selected by PRM0n, and a capture operation is only performed when a valid level of the TI00n pin is detected twice, thus eliminating noise with a short pulse width. Figure 8-23. Control Register Settings for Pulse Width Measurement with Free-Running Counter and One Capture Register (When TI00n and CR01n Are Used) (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 0 1 1 0 OVF0n 0 Free-running mode
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 1 0/1 0 CR00n used as compare register CR01n used as capture register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 1 1 3 0 2 0 PRM01n PRM00n 0/1 0/1 Selects count clock (setting "11" is prohibited). Specifies both edges for pulse width detection. Setting invalid (setting "10" is prohibited.)
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. See the description of the respective control registers for details. n = 0, 1
164
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-24. Configuration Diagram for Pulse Width Measurement with Free-Running Counter
fX (fX/2)Note fX/22 (fX/23)Note fX/2 (fX/2 )
6 9 Note
Selector
16-bit timer/counter 0n
OVF0n
TI000/TO00/P70 (TI001/TO01/BUZ/P75)Note
16-bit timer capture/compare register 01n INTTM01n Internal bus
Note Values outside parentheses apply to 16-bit timer/event counter 00, and values in parentheses apply to 16bit timer/event counter 01. Figure 8-25. Timing of Pulse Width Measurement Operation with Free-Running Counter and One Capture Register (with Both Edges Specified)
t
Count clock TM0n count value TI00n pin input CR01n capture value INTTM01n OVF0n (D1 -- D0) x t (10000H -- D1 + D2) x t Note (D3 -- D2) x t D0 D1 D2 D3 0000H 0001H D0 D0 + 1 D1 D1 + 1 FFFFH 0000H D2 D3
Note OVF0n must be cleared by software. Remark n = 0, 1
User's Manual U14260EJ3V1UD
165
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(2) Measurement of two pulse widths with free-running counter When 16-bit timer counter 0n (TM0n) is operated in free-running mode, it is possible to simultaneously measure the pulse widths of the two signals input to the TI00n pin and the TI01n pin. When the edge specified by bits 4 and 5 (ES00n and ES01n) of prescaler mode register 0n (PRM0n) is input to the TI00n pin, the value of TM0n is taken into 16-bit timer capture/compare register 01n (CR01n) and an interrupt request signal (INTTM01n) is set. Also, when the edge specified by bits 6 and 7 (ES10n and ES11n) of PRM0n is input to the TI01n pin, the value of TM0n is taken into 16-bit timer capture/compare register 00n (CR00n) and an external interrupt request signal (INTTM00n) is set. The both falling and rising edges can be specified as the valid edges for the TI00n pin and the TI01n pin by bits 4 and 5 (ES00n and ES01n) and bits 6 and 7 (ES10n and ES11n) of PRM0n, respectively. Sampling is performed with the count clock cycle selected by prescaler mode register 0n (PRM0n), and a capture operation is only performed when a valid level of the TI00n pin or TI01n pin is detected twice, thus eliminating noise with a short pulse width. Figure 8-26. Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 0 1 1 0 OVF0n 0 Free-running mode
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 1 0 1 CR00n used as capture register Captures valid edge of TI01n pin to CR00n CR01n used as capture register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 1 1 1 1 3 0 2 0 PRM01n PRM00n 0/1 0/1 Selects count clock (setting "11" is prohibited). Specifies both edges for pulse width detection. Specifies both edges for pulse width detection.
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. See the description of the respective control registers for details. n = 0, 1
166
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-27. Timing of Pulse Width Measurement Operation with Free-Running Counter (with Both Edges Specified)
t
Count clock TM0n count value TI00n pin input CR01n capture value INTTM01n TI01n pin input CR00n capture value INTTM00n OVF0n Note D1 D2 + 1 D0 D1 D2 0000H 0001H D0 D0 + 1 D1 D1 + 1 FFFFH 0000H D2 D2 + 1 D2 + 2 D3
(D1 -- D0) x t
(10000H -- D1 + D2) x t
(D3 -- D2) x t
(10000H -- D1 + (D2 + 1)) x t
Note OVF0n must be cleared by software. Remark n = 0, 1
User's Manual U14260EJ3V1UD
167
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(3) Pulse width measurement with free-running counter and two capture registers When 16-bit timer counter 0n (TM0n) is operated in free-running mode, it is possible to measure the pulse width of the signal input to the TI00n pin. When the rising or falling edge specified by bits 4 and 5 (ES00n and ES01n) of prescaler mode register 0n (PRM0n) is input to the TI00n pin, the value of TM0n is taken into 16-bit timer capture/compare register 01n (CR01n) and an interrupt request signal (INTTM01n) is set. Also, when the inverse edge to that of the capture operation to CR01n is input, the value of TM0n is taken into 16-bit timer capture/compare register 00n (CR00n). Sampling is performed with the count clock cycle selected by prescaler mode register 0n (PRM0n), and a capture operation is only performed when a valid level of the TI00n pin is detected twice, thus eliminating noise with a short pulse width. Caution If the valid edge of the TI00n pin is specified to be both the rising and falling edges, 16-bit timer capture/compare register 00n (CR00n) cannot perform the capture operation. Figure 8-28. Control Register Settings for Pulse Width Measurement with Free-Running Counter and Two Capture Registers (with Rising Edge Specified) (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 0 1 1 0 OVF0n 0 Free-running mode
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 1 1 1 CR00n used as capture register Captures to CR00n at edge reverse to valid edge of TI00n pin. CR01n used as capture register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0 1 3 0 2 0 PRM01n PRM00n 0/1 0/1 Selects count clock (setting "11" is prohibited). Specifies rising edge for pulse width detection. Setting invalid (setting "10" is prohibited.)
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with pulse width measurement. See the description of the respective control registers for details. n = 0, 1
168
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-29. Timing of Pulse Width Measurement Operation with Free-Running Counter and Two Capture Registers (with Rising Edge Specified)
t
Count clock TM0n count value TI00n pin input CR01n capture value CR00n capture value INTTM01n OVF0n (D1 -- D0) x t (10000H -- D1 + D2) x t Note (D3 -- D2) x t D0 D1 D2 D3 0000H 0001H D0 D0 + 1 D1 D1 + 1 FFFFH 0000H D2 D2 + 1 D3
Note OVF0n must be cleared by software. (4) Pulse width measurement by means of restart When input of a valid edge to the TI00n pin is detected, the count value of 16-bit timer/counter 0n (TM0n) is taken into 16-bit timer capture/compare register 01n (CR01n), and then the pulse width of the signal input to the TI00n pin is measured by clearing TM0n and restarting the count. The edge specification can be selected from two types, rising or falling edges, by bits 4 and 5 (ES00n and ES01n) of prescaler mode register 0n (PRM0n). Sampling is performed with the count clock cycle selected by prescaler mode register 0n (PRM0n) and a capture operation is only performed when a valid level of the TI00n pin is detected twice, thus eliminating noise with a short pulse width. Caution If the valid edge of the TI00n pin is specified to be both the rising and falling edges, 16-bit timer capture/compare register 00n (CR00n) cannot perform the capture operation. Remark n = 0, 1
User's Manual U14260EJ3V1UD
169
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-30. Control Register Settings for Pulse Width Measurement by Means of Restart (with Rising Edge Specified) (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 1 0 1 0 OVF0n 0 Clears and starts at valid edge of TI00n pin.
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 1 1 1 CR00n used as capture register Captures to CR00n at edge reverse to valid edge of TI00n pin. CR01n used as capture register
(c) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0 1 3 0 2 0 PRM01n PRM00n 0/1 0/1 Selects count clock (setting "11" is prohibited). Specifies rising edge for pulse width detection. Setting invalid (setting "10" is prohibited.)
Figure 8-31. Timing of Pulse Width Measurement Operation by Means of Restart (with Rising Edge Specified)
t
Count clock TM0n count value TI00n pin input CR01n capture value CR00n capture value INTTM01n D1 x t D2 x t D0 D1 D2 0000H 0001H D0 0000H 0001H D1 D2 0000H 0001H
Remark n = 0, 1
170
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.4.4 Square-wave output operation Setting The basic operation setting procedure is as follows. <1> Set the count clock by using the PRM0n register. <2> Set the CRC0n register (see Figure 8-32 for the set value). <3> Set the TOC0n register (see Figure 8-32 for the set value). <4> Set any value to the CR00n register (0000H cannot be set). <5> Set the TMC0n register to start the operation (see Figure 8-32 for the set value). Remarks 1. For the setting of the TO0n pin, see 8.3 (5) Port mode register 7 (PM7). 2. For how to enable the INTTM00n interrupt, see CHAPTER 19 INTERRUPT FUNCTIONS. A square wave with any selected frequency can be output at intervals determined by the count value preset to 16-bit timer capture/compare register 00n (CR00n). The TO0n pin output status is reversed at intervals determined by the count value preset to CR00n + 1 by setting bit 0 (TOE0n) and bit 1 (TOC01n) of 16-bit timer output control register 0n (TOC0n) to 1. This enables a square wave with any selected frequency to be output. Figure 8-32. Control Register Settings in Square-Wave Output Mode (1/2) (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 1 1 1 0 OVF0n 0 Clears and starts on match between TM0n and CR00n.
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 0/1 0/1 0 CR00n used as compare register
Remark n = 0, 1
User's Manual U14260EJ3V1UD
171
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-32. Control Register Settings in Square-Wave Output Mode (2/2) (c) 16-bit timer output control register 0n (TOC0n)
7 TOC0n 0 6 0 5 0 TOC04n LVS0n LVR0n TOC01n TOE0n 0 0/1 0/1 1 1 Enables TO0n output. Reverses output on match between TM0n and CR00n. Specifies initial value of TO0n output F/F (setting "11" is prohibited). Does not reverse output on match between TM0n and CR01n.
(d) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0/1 0/1
3 0
2 0
PRM01n PRM00n 0/1 0/1 Selects count clock. Setting invalid (setting "10" is prohibited.) Setting invalid (setting "10" is prohibited.)
Remark 0/1: Setting 0 or 1 allows another function to be used simultaneously with square-wave output. See the description of the respective control registers for details. n = 0, 1 Figure 8-33. Square-Wave Output Operation Timing
Count clock TM0n count value CR00n INTTM00n TO0n pin output 0000H 0001H 0002H N N-1 N 0000H 0001H 0002H N-1 N 0000H
Remark n = 0, 1
172
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.4.5 PPG output operation Setting 16-bit timer mode control register 0n (TMC0n) and capture/compare control register 0n (CRC0n) as shown in Figure 8-34 allows operation as PPG (Programmable Pulse Generator) output. Setting The basic operation setting procedure is as follows. <1> Set the CRC0n register (see Figure 8-34 for the set value). <2> Set any value to the CR00n register as the cycle. <3> Set any value to the CR01n register as the duty factor. <4> Set the TOC0n register (see Figure 8-34 for the set value). <5> Set the count clock by using the PRM0n register. <6> Set the TMC0n register to start the operation (see Figure 8-34 for the set value). Remarks 1. For the setting of the TO0n pin, see 8.3 (5) Port mode register 7 (PM7). 2. For how to enable the INTTM00n interrupt, see CHAPTER 19 INTERRUPT FUNCTIONS. In the PPG output operation, square waves are output from the TO0n pin with the pulse width and the cycle that correspond to the count values set beforehand in 16-bit timer capture/compare register 01n (CR01n) and in 16-bit timer capture/compare register 00n (CR00n), respectively. Remark n = 0, 1
User's Manual U14260EJ3V1UD
173
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-34. Control Register Settings for PPG Output Operation (a) 16-bit timer mode control register 0n (TMC0n)
7 TMC0n 0 6 0 5 0 4 0 TMC0n3 TMC0n2 1 1 1 0 OVF0n 0 Clears and starts on match between TM0n and CR00n.
(b) Capture/compare control register 0n (CRC0n)
7 CRC0n 0 6 0 5 0 4 0 3 0 CRC02n CRC01n CRC00n 0 x 0 CR00n used as compare register CR01n used as compare register
(c) 16-bit timer output control register 0n (TOC0n)
7 TOC0n 0 6 0 5 0 TOC04n LVS0n LVR0n TOC01n TOE0n 1 0/1 0/1 1 1 Enables TO0n output. Reverses output on match between TM0n and CR00n. Specifies initial value of TO0n output F/F (setting "11" is prohibited). Reverses output on match between TM0n and CR01n.
(d) Prescaler mode register 0n (PRM0n)
ES11n ES10n ES01n ES00n PRM0n 0/1 0/1 0/1 0/1
3 0
2 0
PRM01n PRM00n 0/1 0/1 Selects count clock. Setting invalid (setting "10" is prohibited.) Setting invalid (setting "10" is prohibited.)
Cautions 1. CR00n and CR01n values in the following range should be set to: 0000H CR01n < CR00n FFFFH 2. The cycle of the pulse generated via PPG output (CR00n setting value + 1) has a duty of (CR01n setting value + 1)/(CR00n setting value + 1). Remarks 1. x : Don't care 2. n = 0, 1
174
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-35. PPG Output Configuration Diagram
16-bit timer capture/ compare register 00n
Selector
fX (fX/2)Note fX/22 (fX/23)Note fX/26 (fX/29)Note
16-bit timer counter 0n
Clear circuit
Output controller
TO00/TI000/P70 (TO01/TI001/P75)Note
16-bit timer capture/compare register 01n
Note Values outside parentheses apply to 16-bit timer/event counter 00, and values in the parentheses apply to 16-bit timer/event counter 01. Figure 8-36. PPG Output Operation Timing
t
Count clock TM0n count value N 0000H 0001H M-1 M N-1 N 0000H 0001H
Clear CR00n capture value CR01n capture value TO0n Pulse width: (M + 1) x t 1 cycle: (N + 1) x t N M
Clear
Remark 0000H M < N FFFFH n = 0, 1
User's Manual U14260EJ3V1UD
175
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5 Program List
Caution The following sample program is shown as an example to describe the operation of semiconductor products and their applications. responsibility. Therefore, when applying the following information to your devices, design the devices after performing evaluation under your own
176
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5.1 Interval timer /*******************************************************************************/ /* */ /* Setting example of timer 00 interval timer mode */ /* Cycle set to 130 as intervalTM00 (at 8.38 MHz for 1 ms) */ /* Variable ppgdata prepared as rewrite data area */ /* : Cycle (if 0000, no change) */ /* ppgdata to be checked at every INTTM000, and changed if required. */ /* Therefore, if change is required, set the change data in ppgdata. */ /* When changed, ppgdata cleared to 0000. */ /* */ /*******************************************************************************/ #pragma sfr #pragma EI #pragma DI #define intervalTM00 130 /* Cycle data to be set to CR000 */ #pragma interrupt INTTM000 intervalint rb2 unsigned int ppgdata; /* Data area to be set to timer 00 */ void main(void) { PCC = 0x0; ppgdata = 0;
/* Set high-speed operation mode */ /* /* /* /* /* /* /* /* /* /* /* /* Set port */ Set the following to output */ Clear P70 */ Set P70 as output */ Set interrupt */ Cancel INTTM000 interrupt mask */ Set timer 00 */ Count clock is fx/2^6 */ Set CR000 and CR010 to compare register */ Set cycle initial value to CR000 */ Invert on match with CR000, initial value L */ Clear & start on match between TM00 and CR000 */
P7 = 0b11111110; PM7.0 = 0; TMMK000 = 0; PRM00 CRC00 CR000 TOC00 TMC00 EI(); = = = = = 0b00000010; 0b00000000; intervalTM00; 0b00000111; 0b00001100;
while(1); }
/* Loop as dummy here */
/* Timer 00 interrupt function */ void intervalint() { unsigned int work; /***************************************************/ /* */ /* Define variables required for interrupt here */ /* */ /***************************************************/ work = ppgdata; if (work != 0) { CR000 = work; ppgdata = 0; if (work == 0xffff) { TMC00 = 0b00000000; /* Stop timer */ } } /***********************************************************/ /* */ /* Describe processing required for interrupt below */ /* */ /***********************************************************/ }
User's Manual U14260EJ3V1UD
177
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5.2 Pulse width measurement by free-running counter and one capture register /******************************************************************************/ /* */ /* Timer 00 operation sample */ /* Pulse width measurement example by free-running and CR010 */ /* Measurement results to be up to 16 bits and not checked for errors */ /* data[0]: End flag */ /* data[1]: Measurement results (pulse width) */ /* data[2]: Previous read value */ /* */ /******************************************************************************/ #pragma sfr #pragma EI #pragma DI #pragma interrupt INTTM010 intervalint rb2 unsigned int data[3]; /* Data area */ void main(void) { unsigned int length; PCC = 0x0; data[0] = 0; data[1] = 0; data[2] = 0; PM7.0 = 1; TMMK010 = 0; PRM00 = 0b00110010; CRC00 = 0b00000100; TMC00 = 0b00000100; EI(); while(1){ while(data[0] == 0); DI(); length = data[1]; data[0] = 0; EI(); } } /* Timer 00 interrupt function */ void intervalint() { unsigned int work; /*****************************************************/ /* */ /* Define variables required for interrupt here */ /* */ /*****************************************************/ work = CR010; /* Read capture value */ data[1] = work - data[2]; /* Calculate and update interval */ data[2] = work; /* Update read value */ data[0] = 0xffff; /* Set measurement completion flag*/ /***********************************************************/ /* */ /* Describe processing required for interrupt below */ /* */ /***********************************************************/ }
/* Set high-speed operation mode */
/* /* /* /* /* /* /* /* /* /* /* /* /* /* /*
Set port */ Set P70 as input */ Set interrupt */ Cancel INTTM010 interrupt mask */ Set timer 00 */ Both rising and falling edges for TI000 */ Count clock is fx/2^6 */ Set CR010 to capture register */ Start in free-run mode */ Dummy loop */ Wait for measurement completion */ Disable interrupt for exclusive operation */ Read measurement results */ Clear end flag */ Exclusive operation completed */
178
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5.3 Two pulse widths measurement by free-running counter /******************************************************************************/ /* */ /* Timer 00 operation sample */ /* Two-pulse-width measurement sample by free-running */ /* Measurement results to be up to 16 bits and not checked for errors */ /* Result area at TI000 side */ /* data[0]: End flag */ /* data[1]: Measurement results (pulse width) */ /* data[2]: Previous read value */ /* Result area at TI010 side */ /* data[3]: End flag */ /* data[4]: Measurement results (pulse width) */ /* data[5]: Previous read value */ /* */ /******************************************************************************/ #pragma sfr #pragma EI #pragma DI #pragma interrupt INTTM000 intervalint rb2 #pragma interrupt INTTM010 intervalint2 rb2 unsigned int data[6]; /* Data area */ void main(void) { unsigned int length,length2; PCC = 0x0; data[0] = 0; data[1] = 0; data[2] = 0; data[3] = 0; data[4] = 0; data[5] = 0;
/* Set high-speed operation mode */ /* Clear data area */
PM7.0 = 1; PM7.1 = 1; TMMK010 = 0; TMMK000 = 0; PRM00 = 0b11110010; CRC00 = 0b00000101; TMC00 = 0b00000100; EI(); while(1){ if(data[0] != 0) { TMMK010 = 1;
/* /* /* /* /* /* /* /* /* /* /*
Set port */ Set P70 as input */ Set P71 as input */ Set interrupt */ Cancel INTTM010 interrupt mask */ Cancel INTTM000 interrupt mask */ Set timer 00 */ Both rising and falling edges */ Count clock is fx/2^6 */ Set CR000 and CR010 to capture register */ Start in free-run mode */
/* Dummy loop */ /* TI000 measurement completion check */ /* INTTM010 interrupt disabled for exclusive operation */ /* Read measurement results */ /* Clear end flag */ /* Exclusive operation completed */
length = data[1]; data[0] = 0; TMMK010 = 0; } if(data[3] != 0) { TMMK000 = 1;
/* TI010 measurement completion check */ /* INTTM000 interrupt disabled for exclusive operation */ /* Read measurement results */ /* Clear end flag */ /* Exclusive operation completed */
length2 = data[4]; data[3] = 0; TMMK000 = 0; } } }
User's Manual U14260EJ3V1UD
179
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
/* INTTM000 interrupt function */ void intervalint() { unsigned int work; /******************************************************/ /* */ /* Define variables required for interrupt here */ /* */ /******************************************************/ work = CR000; /* Read capture value */ data[4] = work - data[5]; /* Calculate and update interval */ data[5] = work; /* Update read value */ data[3] = 0xffff; /* Set measurement completion flag */ /********************************************************/ /* */ /* Describe processing required for interrupt below */ /* */ /********************************************************/ } /* INTTM010 interrupt function */ void intervalint2() { unsigned int work; /******************************************************/ /* */ /* Define variables required for interrupt here */ /* */ /******************************************************/ work = CR010; /* Read capture value */ data[1] = work - data[2]; /* Calculate and update interval */ data[2] = work; /* Update read value */ data[0] = 0xffff; /* Set measurement completion flag */ /********************************************************/ /* */ /* Describe processing required for interrupt below */ /* */ /********************************************************/ }
180
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5.4 Pulse width measurement by restart /**************************************************************************/ /* */ /* Timer 00 operation sample */ /* Pulse width measurement example by restart */ /* Measurement results up to 16 bits, not to be checked for errors */ /* data[0]: End flag */ /* data[1]: Measurement results (pulse width) */ /* data[2]: Previous read value */ /* */ /**************************************************************************/ #pragma sfr #pragma EI #pragma DI #pragma interrupt INTTM010 intervalint rb2 unsigned int data[3]; /* Data area */ void main(void) { unsigned int length; PCC = 0x0; data[0] = 0; data[1] = 0; data[2] = 0; PM7.0 = 1; TMMK010 = 0; PRM00 = 0b00110010; CRC00 = 0b00000100; TMC00 = 0b00001000; EI(); while(1){ if(data[0] != 0) { TMMK010 = 1;
/* Set high-speed operation mode */
/* /* /* /* /* /* /* /* /*
Set port */ Set P70 as input */ Set interrupt */ Cancel INTTM010 interrupt mask */ Set timer 00 */ Both rising and falling edges */ Count clock is fx/2^6 */ Set CR010 to capture register */ Clear & start at TI000 valid edge */
/* Dummy loop */ /* Wait for TI000 measurement completion */
/* Disable INTTM010 for exclusive operation */ length = data[1]+data[2]; /* Cycle calculation based on measurement results */ data[0] = 0; /* Clear end flag */ TMMK010 = 0; /* Exclusive operation completed */
} } } /* Timer00 interrupt function */ void intervalint() { /******************************************************/ /* */ /* Define variables required for interrupt here */ /* */ /******************************************************/ data[2] = data[1]; /* Update old data */ data[1] = CR010; /* Update read value */ data[0] = 0xffff; /* Set measurement completion flag*/ /********************************************************/ /* */ /* Describe processing required for interrupt below */ /* */ /********************************************************/ }
User's Manual U14260EJ3V1UD
181
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.5.5 PPG output /******************************************************************************/ /* */ /* Timer 00 PPG mode setting example */ /* Cycle set to 130 as intervalTM00 */ /* Active period set to 65 as active_time */ /* Array ppgdata prepared as data area for rewriting */ /* [0]: Active period (0000: no change, 0xffff: stop) */ /* [1]: Cycle (0000: no change) */ /* ppgdata to be checked at every INTTM000, and changed if required. */ /* Therefore, if change is required, set the change data in ppgdata. */ /* When changed, ppgdata cleared to 0000. */ /* */ /******************************************************************************/ #pragma sfr #pragma EI #pragma DI #define intervalTM00 130 /* Cycle data to be set to CR000 */ #define active_time 65 /* Initial value data of CR010 */ #pragma interrupt INTTM000 ppgint rb2 unsigned int ppgdata[2]; /* Data area to be set to timer 00 */ void main(void) { PCC = 0x0; ppgdata[0] = 0; ppgdata[1] = 0; P7 = 0b11111110; PM7.0 = 0; TMMK000 = 0; PRM00 CRC00 CR000 CR010 TOC00 = = = = = 0b00000010; 0b00000000; intervalTM00; active_time; 0b00010111;
/* Set high-speed operation mode */
/* /* /* /* /* /* /* /* /* /* /*
TMC00 = 0b00001100; EI(); while(1); }
Set port */ Clear P70 */ Set P70 to output */ Set interrupt */ Cancel INTTM000 interrupt mask */ Set timer 00 */ Count clock is fx/2^6 */ Set CR000 and CR010 to compare register */ Set initial value of cycle */ Set initial value of active period */ Inverted on match between CR000 and CR010, initial value L */ /* Clear & start on match between TM00 and CR000 */
/* Timer 00 interrupt function */ void ppgint() { unsigned int work; work = ppgdata[0]; if (work != 0) { CR010 = work; ppgdata[0] = 0; if (work == 0xffff) { TMC00 = 0b00000000; } } work = ppgdata[1]; if (work != 0) { CR000 = work; ppgdata[1]=0; } }
/* Stop timer */
182
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
8.6 Cautions for 16-Bit Timer/Event Counters 00, 01
(1) Timer start errors An error of up to one clock may occur in the time required for a match signal to be generated after timer start. This is because 16-bit timer counter 0n (TM0n) is started asynchronously to the count clock. Figure 8-37. Start Timing of 16-Bit Timer Counter 0n (TM0n)
Count clock
TM0n count value
0000H
0001H
0002H
0003H
0004H
Timer start
(2) 16-bit timer capture/compare register setting In the clear & start mode entered on a match between TM0n and CR00n, set a value other than 0000H to 16bit timer capture/compare register 00n (CR00n). This means a 1-pulse count operation cannot be performed when 16-bit timer/event counter 0n is used as an external event counter. (3) Capture register data retention timing The values of 16-bit timer capture/compare registers 00n and 01n (CR00n and CR01n) are not guaranteed after 16-bit timer/event counter 0n has been stopped. (4) Valid edge setting Set the valid edge of the TI00n pin after setting bits 2 and 3 (TMC0n2 and TMC0n3) of 16-bit timer mode control register 0n (TMC0n) to 0, 0, respectively, and then stopping the timer operation. The valid edge is set by bits 4 and 5 (ES00n and ES01n) of prescaler mode register 0n (PRM0n). Remark n = 0, 1
User's Manual U14260EJ3V1UD
183
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(5) Operation of OVF0n flag <1> The OVF0n flag is also set to 1 in the following case. Either of the clear & start mode entered on a match between TM0n and CR00n, clear & start at the valid edge of the TI00n pin, or free-running mode is selected. CR00n is set to FFFFH. When TM0n is counted up from FFFFH to 0000H. Figure 8-38. Operation Timing of OVF0n Flag
Count clock CR00n TM0n OVF0n INTTM00n FFFFH FFFEH FFFFH 0000H 0001H
<2> Even if the OVF0n flag is cleared before the next count clock is counted (before TM0n becomes 0001H) after the occurrence of a TM0n overflow, the OVF0 flag is reset newly and clear is disabled. (6) Conflicting operations <1> When the 16-bit timer capture/compare register (CR00n/CR01n) is used as a compare register, if the write period and the match timing of 16-bit timer counter 0n (TM0n) conflict, match determination is not successfully done. Do not perform a write operation of CR00n/CR01n near the match timing. <2> If the read period and capture trigger input conflict when CR00n/CR01n is used as a capture register, capture trigger input has priority. The data read from CR00n/CR01n is undefined. Remark n = 0, 1
184
User's Manual U14260EJ3V1UD
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
Figure 8-39. Capture Register Data Retention Timing
Count clock TM0n count value Edge input INTTM01n Capture read signal CR01n capture value X N+1 M+1 N N+1 N+2 M M+1 M+2
Capture
Read value not guaranteed though capture operation performed
(7) Timer operation <1> Even if 16-bit timer counter 0n (TM0n) is read, the value is not captured by 16-bit timer capture/compare register 01n (CR01n). <2> Regardless of the CPU's operation mode, when the timer stops, the signals input to pins TI00n/TI01n are not acknowledged. (8) Capture operation <1> If the TI00n pin is specified as the valid edge of the count clock, a capture operation by the capture register specified as the trigger for the TI00n pin is not possible. <2> If both the rising and falling edges are selected as the valid edges of the TI00n pin, capture is not performed. <3> To ensure the reliability of the capture operation, the capture trigger requires a pulse longer than two cycles of the count clock selected by prescaler mode register 0n (PRM0n). <4> The capture operation is performed at the fall of the count clock. An interrupt request input (INTTM0nn), however, occurs at the rise of the next count clock. (9) Compare operation <1> When the 16-bit timer capture/compare register (CR00n/CR01n) is overwritten during timer operation, match interrupt may be generated or the clear operation may not be performed normally if that value is close to or large than the timer value. <2> The capture operation may not be performed for CR00n/CR01n set in compare mode even if a capture trigger is input. Remark n = 0, 1
User's Manual U14260EJ3V1UD
185
CHAPTER 8
16-BIT TIMER/EVENT COUNTERS 00, 01
(10) Edge detection <1> If the TI00n pin or the TI01n pin is high level immediately after system reset and the rising edge or both the rising and falling edges are specified as the valid edge for the TI00n pin or TI01n pin to enable 16-bit timer counter 0n (TM0n) operation, a rising edge is detected immediately. Be careful when pulling up the TI00n pin or the TI01n pin. However, the rising edge is not detected at restart after the operation has been stopped once. <2> The sampling clock used to eliminate noise differs when the valid edge of the TI00n pin is used as the count clock and when it is used as a capture trigger. In the former case, the count clock is fX/23, and in the latter case the count clock is selected by prescaler mode register 0n (PRM0n). The capture operation is not performed until the valid edge is sampled and the valid level is detected twice, thus eliminating noise with a short pulse width. (11) STOP mode or main system clock stop mode setting Except when the TI00n, TI01n pin input is selected, stop the timer operation before setting STOP mode or main system clock stop mode; otherwise the timer may malfunction when the main system clock starts. Remark n = 0, 1
186
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.1 Functions of 8-Bit Timer/Event Counters 50, 51
8-bit timer/event counters 50, 51 (TM50, TM51) have the following two modes. (1) Mode using 8-bit timer/event counters 50, 51 alone (discrete mode) The timer operates as 8-bit timer/event counter 50 or 51. It has the following functions. <1> Interval timer Interrupt requests are generated at the preset interval. * Number of counts: 1 to 256
<2> External event counter The number of pulses with high/low level widths of the signal input externally can be measured. <3> Square-wave output A square wave with an arbitrary frequency can be output. * Cycle: (1 x 2 to 256 x 2) x Cycles of count clock
<4> PWM output A pulse with an arbitrary duty ratio can be output. * * Cycle: Count clock x 256 Duty ratio: Set value of compare register/256
(2) Mode using cascade connection (16-bit resolution: cascade connection mode) The timer operates as a 16-bit timer/event counter by combining two 8-bit timer/event counters. It has the following functions. * Interval timer with 16-bit resolution * External event counter with 16-bit resolution * Square-wave output with 16-bit resolution Figures 9-1 and 9-2 show block diagrams of 8-bit timer/event counters 50 and 51.
User's Manual U14260EJ3V1UD
187
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-1. Block Diagram of 8-Bit Timer/Event Counter 50
Internal bus
Mask circuit
8-bit timer compare register 50 (CR50) TI50/TO50/P72Note 1 fX fX/22 fX/24 fX/26 fX/28 fX/210 Match
Selector
Selector Note 2 S Q INV R Note 3 S Invert level
INTTM50
8-bit timer OVF counter 50 (TM50) Clear
Selector
TO50/TI50/ P72Note 1
3 Selector
R
Output latch (P72)
PM72
TCL502 TCL501 TCL500 Timer clock selection register 50 (TCL50)
TCE50 TMC506 TMC504 LVS50 LVR50 TMC501 TOE50 8-bit timer mode control register 50 (TMC50) Internal bus
Figure 9-2. Block Diagram of 8-Bit Timer/Event Counter 51
Internal bus
Mask circuit
8-bit timer compare register 51 (CR51) TI51/TO51/P73Note 1 fX/2 fX/23 fX/25 fX/27 fX/29 fX/211 Match
Selector
Selector Note 2 S Q INV R Note 3 S Invert level
INTTM51
8-bit timer counter 51 (TM51)
OVF
Selector
TO51/TI51/ P73Note 1
Clear 3 Selector
R
Output latch (P73)
PM73
TCL512 TCL511 TCL510 Timer clock selection register 51 (TCL51)
TCE51 TMC516 TMC514 LVS51 LVR51 TMC511 TOE51 8-bit timer mode control register 51 (TMC51) Internal bus
Notes 1. The respective combinations, TI50 and TO50 pins, and TI51 and TO51 pins, cannot be used at the same time. 2. Timer output F/F 3. PWM output F/F
188
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.2 Configuration of 8-Bit Timer/Event Counters 50, 51
8-bit timer/event counters 50, 51 consist of the following hardware. Table 9-1. Configuration of 8-Bit Timer/Event Counters 50, 51
Item Timer counter Register Timer input Timer output Control registers Configuration 8-bit timer counter 5n (TM5n) 8-bit timer compare register 5n (CR5n) TI5n TO5n Timer clock select register 5n (TCL5n) 8-bit timer mode control register 5n (TMC5n) Port mode register 7 (PM7) Port register 7 (P7)
(1) 8-bit timer counter 5n (TM5n: n = 0, 1) TM5n is an 8-bit read-only register that counts the count pulses. The counter is incremented in synchronization with the rising edge of the count clock. Figure 9-3. Format of 8-Bit Timer Counter 5n (TM5n)
Address: FF12H (TM50), FF13H (TM51) Symbol TM5n (n = 0, 1)
After reset: 00H
R
When TM50 and TM51 can be connected in cascade and used as a 16-bit timer, they can be read by a 16-bit memory manipulation instruction. However, since they are connected by an internal 8-bit bus, TM50 and TM51 are read separately twice in that order. Thus, take reading during the count change into consideration and compare them by reading twice. When the count value is read during operation, the count clock input is temporarily stoppedNote, and then the count value is read. In the following situations, count value is set to 00H. <1> RESET input <2> When TCE5n is cleared <3> When TM5n and CR5n match in the clear & start mode entered on a match between TM5n and CR5n. Note An error may occur in the count. Select a count clock that has a high/low level longer than two cycles of the CPU clock. Caution In cascade connection mode, the count value is reset to 0000H when TCE50 of the lowest timer is cleared. Remark n = 0, 1
User's Manual U14260EJ3V1UD
189
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
(2) 8-bit timer compare register 5n (CR5n: n = 0, 1) When CR5n is used as a compare register in other than PWM mode, the value set in CR5n is constantly compared with the 8-bit timer counter (TM5n) count value, and an interrupt request (INTTM5n) is generated if they match. In PWM mode, the TO5n pin goes to the active level by the overflow of TM5n. When the values of TM5n and CR5n match, the TO5n pin goes to the inactive level. It is possible to rewrite the value of CR5n within 00H to FFH during a count operation. When TM50 and TM51 can be connected in cascade and used as a 16-bit timer, CR50 and CR51 operate as a 16-bit compare register. This register compares the count value with the register value, and if the values match, an interrupt request (INTTM50) is generated. The INTTM51 interrupt request is also generated at this time. Thus, mask the INTTM51 interrupt request. CR5n is set by an 8-bit memory manipulation instruction. CR5n is undefined when RESET is input. Figure 9-4. Format of 8-Bit Timer Compare Register 5n (CR5n)
Address: FF10H (CR50), FF11H (CR51) Symbol CR5n (n = 0, 1)
After reset: Undefined
R/W
Cautions 1. CR5n can be rewritten in PWM mode only once per cycle. 2. In cascade connection mode, stop the timer operation before setting data. Remark n = 0, 1
190
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.3 Registers to Control 8-Bit Timer/Event Counters 50, 51
The following four types of registers are used to control 8-bit timer/event counters 50, 51. * Timer clock select register 5n (TCL5n) * 8-bit timer mode control register 5n (TMC5n) * Port mode register 7 (PM7) * Port register 7 (P7) Remark n = 0, 1 (1) Timer clock select register 5n (TCL5n: n = 0, 1) This register sets the count clock of 8-bit timer/event counter 5n and the valid edge of TI50, TI51 input. TCL5n is set by an 8-bit memory manipulation instruction. RESET input clears TCL5n to 00H. Figure 9-5. Format of Timer Clock Select Register 50 (TCL50)
Address: FF71H Symbol TCL50 7 0 After reset: 00H 6 0 R/W 5 0 4 0 3 0 2 TCL502 1 TCL501 0 TCL500
TCL502
TCL501
TCL500
Count clock selection fX = 8.38 MHz fX = 12 MHzNote - - 12 MHz 3 MHz 750 kHz 187 kHz 46.8 kHz 11.7 kHz
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
TI50 falling edge TI50 rising edge fX fX/22 fX/24 fX/26 fX/28 fX/210
- - 8.38 MHz 2.09 MHz 523 kHz 131 kHz 32.7 kHz 8.18 kHz
Note Expanded-specification products of PD780078 Subseries only. Cautions 1. When rewriting TCL50 to other data, stop the timer operation beforehand. 2. Be sure to set bits 3 to 7 to 0. Remarks 1. When cascade connection is used, only TCL50 is valid for count clock setting. 2. fX: Main system clock oscillation frequency
User's Manual U14260EJ3V1UD
191
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-6. Format of Timer Clock Select Register 51 (TCL51)
Address: FF79H Symbol TCL51 7 0 After reset: 00H 6 0 R/W 5 0 4 0 3 0 2 TCL512 1 TCL511 0 TCL510
TCL512
TCL511
TCL510
Count clock selection fX = 8.38 MHz fX = 12 MHzNote - - 6 MHz 1.5 MHz 375 kHz 93.7 kHz 23.4 kHz 5.85 kHz
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
TI51 falling edge TI51 rising edge fX/2 fX/23 fX/25 fX/27 fX/29 fX/211
- - 4.19 MHz 1.04 MHz 261 kHz 65.4 kHz 16.3 kHz 4.09 kHz
Note Expanded-specification products of PD780078 Subseries only. Cautions 1. When rewriting TCL51 to other data, stop the timer operation beforehand. 2. Be sure to set bits 3 to 7 to 0. Remarks 1. When cascade connection is used, only TCL50 is valid for count clock setting. 2. fX: Main system clock oscillation frequency (2) 8-bit timer mode control register 5n (TMC5n: n = 0, 1) TMC5n is a register that makes the following six settings. <1> 8-bit timer counter 5n (TM5n) count operation control <2> 8-bit timer counter 5n (TM5n) operating mode selection <3> Discrete mode/cascade connection mode selection (TMC51 only) <4> Timer output F/F (flip-flop) status setting <5> Active level selection in timer F/F control or PWM (free-running) mode <6> Timer output control TMC5n is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears TMC5n to 00H.
192
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-7. Format of 8-Bit Timer Mode Control Register 50 (TMC50)
Address: FF70H Symbol TMC50 7 TCE50 After reset: 00H 6 TMC506 R/W 5 0 4 0 3 LVS50 2 LVR50 1 TMC501 0 TOE50
TCE50 0 1
TM50 count operation control After clearing to 0, count operation disabled (prescaler disabled) Count operation start
TMC506 0 1
TM50 operating mode selection Clear and start mode by match between TM50 and CR50 PWM (free-running) mode
LVS50 0 0 1 1
LVR50 0 1 0 1 No change
Timer output F/F status setting
Timer output F/F reset (0) Timer output F/F set (1) Setting prohibited
In other modes (TMC506 = 0) TMC501 0 1 Timer F/F control Inversion operation disabled Inversion operation enabled
In PWM mode (TMC506 = 1) Active level selection Active high Active low
TOE50 0 1 Output disabled (port mode) Output enabled
Timer output control
Cautions 1. The settings of LVS50 and LVR50 are valid in modes other than the PWM mode. 2. Do not set <1> to <3> below at the same time. Set as follows. <1> TMC501 and TMC506: <3> Set TCE50 Set LVS50 and LVR50 before <3>. 3. Stop operation before rewriting TMC506. Remarks 1. In PWM mode, PWM output will be inactive because TCE50 = 0. 2. If LVS50 and LVR50 are read, 0 is read. 3. The values of the TMC506, LVS50, LVR50, TMC501, and TOE50 bits are reflected to the TO50 output regardless of the value of TCE50. Setting of operation mode <2> Set TOE50 for output enable: Timer output enable
User's Manual U14260EJ3V1UD
193
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-8. Format of 8-Bit Timer Mode Control Register 51 (TMC51)
Address: FF78H Symbol TMC51 7 TCE51 After reset: 00H 6 TMC516 R/W 5 0 4 TMC514 3 LVS51 2 LVR51 1 TMC511 0 TOE51
TCE51 0 1
TM51 count operation control After clearing to 0, count operation disabled (prescaler disabled) Count operation start
TMC516 0 1
TM51 operating mode selection Clear and start mode by match between TM51 and CR51 PWM (free-running) mode
TMC514 0 1 Discrete mode
Discrete mode/cascade connection mode selection
Cascade connection mode (TM50: Lower timer, TM51: Higher timer)
LVS51 0 0 1 1
LVR51 0 1 0 1 No change
Timer output F/F status setting
Timer output F/F reset (0) Timer output F/F set (1) Setting prohibited
In other modes (TMC516 = 0) TMC511 0 1 Timer F/F control Inversion operation disabled Inversion operation enabled
In PWM mode (TMC516 = 1) Active level selection Active high Active low
TOE51 0 1 Output disabled (port mode) Output enabled
Timer output control
Cautions 1. The settings of LVS51 and LVR51 are valid in modes other than the PWM mode. 2. Do not set <1> to <3> below at the same time. Set as follows. <1> TMC511, TMC516, and TMC514: Setting of operation mode <2> Set TOE51 for output enable: <3> Set TCE51 Set LVS51 and LVR51 before <3>. 3. Stop operation before rewriting TMC516. Remarks 1. In PWM mode, PWM output will be inactive because TCE51 = 0. 2. If LVS51 and LVR51 are read, 0 is read. 3. The values of the TMC516, LVS51, LVR51, TMC514, TMC511, and TOE51 bits are reflected to the TO51 output regardless of the value of TCE51. Timer output enable
194
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
(3) Port mode register 7 (PM7) This register sets port 7 input/output in 1-bit units. When using the P72/TO50/TI50 and P73/TI51/TO51 pins for timer output, set PM72 and PM73, and the output latches of P72 and P73 to 0. When using the P72/TO50/TI50 and P73/TI51/TO51 pins for timer input, set PM72 and PM73 to 1. At this time, the output latches of P72 and P73 can be either 0 or 1. PM7 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM7 to FFH. Figure 9-9. Format of Port Mode Register 7 (PM7)
Address: FF27H Symbol PM7 7 1 After reset: FFH 6 1 5 PM75 R/W 4 PM74 3 PM73 2 PM72 1 PM71 0 PM70
PM7n 0 1
P7n pin I/O mode selection (n = 0 to 5) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
195
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.4 Operation of 8-Bit Timer/Event Counters 50, 51
9.4.1 8-bit interval timer operation The 8-bit timer/event counters operate as interval timers that generate interrupt requests repeatedly at intervals of the count value preset to 8-bit timer compare register 5n (CR5n). When the count value of 8-bit timer counter 5n (TM5n) matches the value set to CR5n, counting continues with the TM5n value cleared to 0 and an interrupt request signal (INTTM5n) is generated. The count clock of TM5n can be selected with bits 0 to 2 (TCL5n0 to TCL5n2) of timer clock select register 5n (TCL5n). Setting <1> Set each register. * TCL5n: Select count clock. * CR5n: Compare value (TMC5n = 0000xxx0B x = don't care) <2> After TCE5n = 1 is set, count operation starts. <3> If the values of TM5n and CR5n match, INTTM5n is generated (TM5n is cleared to 00H). <4> INTTM5n is generated repeatedly at the same interval. Set TCE5n to 0 to stop the count operation. Remark n = 0, 1 Figure 9-10. Interval Timer Operation Timing (1/3) (a) Basic operation
t Count clock TM5n count value 00H 01H N 00H 01H N 00H 01H N
* TMC5n: Count operation stop, clear & start mode on match between TM5n and CR5n.
Count start CR5n TCE5n INTTM5n N
Clear N
Clear N N
Interrupt acknowledged Interval time
Interrupt acknowledged Interval time
Remarks 1. Interval time = (N + 1) x t N = 00H to FFH 2. n = 0, 1
196
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-10. Interval Timer Operation Timing (2/3) (b) When CR5n = 00H
t Count clock TM5n 00H CR5n TCE5n INTTM5n Interval time 00H 00H 00H 00H
(c) When CR5n = FFH
t Count clock TM5n CR5n TCE5n INTTM5n Interrupt acknowledged Interval time Interrupt acknowledged FFH 01H FEH FFH FFH 00H FEH FFH FFH 00H
Remark n = 0, 1
User's Manual U14260EJ3V1UD
197
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-10. Interval Timer Operation Timing (3/3) (d) Operated by CR5n transition (M < N)
Count clock TM5n N 00H CR5n TCE5n H INTTM5n CR5n transition TM5n overflows since M < N N M N FFH 00H M M 00H
(e) Operated by CR5n transition (M > N)
Count clock TM5n CR5n TCE5n H INTTM5n CR5n transition N-1 N N 00H 01H N M-1 M M 00H 01H
Remark n = 0, 1
198
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.4.2 External event counter operation The external event counter counts the number of external clock pulses to be input to TI5n using 8-bit timer counter 5n (TM5n). TM5n is incremented each time the valid edge specified by timer clock select register 5n (TCL5n) is input. Either the rising or falling edge can be selected. When the TM5n count value matches the value of 8-bit timer compare register 5n (CR5n), TM5n is cleared to 0 and an interrupt request signal (INTTM5n) is generated. Whenever the TM5n count value matches the value of CR5n, INTTM5n is generated. Setting <1> Set each register. * Set the port mode register (PM72 or PM73)Note to 1 * TCL5n: Edge selection of TI5n input Rising edge of TI5n TCL5n = 00H Falling edge of TI5n TCL5n = 01H * CR5n: Compare value operation disable, timer output disable (TMC5n = 0000xx00B, x = don't care) <2> When TCE5n = 1 is set, the number of pulses input from TI5n is counted. <3> When the values of TM5n and CR5n match, INTTM5n is generated (TM5n is cleared to 00H). <4> Each time the values of TM5n and CR5n match, INTTM5n is generated. Note 8-bit timer/event counter 50: PM72 8-bit timer/event counter 51: PM73 Figure 9-11. External Event Counter Operation Timing (with Rising Edge Specified)
TI5n
Count start
* TMC5n: Count operation stop, clear & start mode on match between TM5n and CR5n, timer F/F inverted
TM5n count value CR5n INTTM5n
00H
01H
02H
03H
04H
05H
N-1
N N
00H
01H
02H
03H
Remarks 1. N = 00H to FFH 2. n = 0, 1
User's Manual U14260EJ3V1UD
199
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.4.3 Square-wave output (8-bit resolution) operation A square wave with any selected frequency is output at intervals determined by the value preset to 8-bit timer compare register 5n (CR5n). The TO5n pin output status is reversed at intervals determined by the count value preset to CR5n by setting bit 0 (TOE5n) of 8-bit timer mode control register 5n (TMC5n) to 1. This enables a square wave with any selected frequency to be output (duty = 50%). Setting <1> Set each register. * Set port output latches (P72, P73)Note and port mode registers (PM72, PM73)Note to 0. * TCL5n: Select count clock * CR5n: Compare value * TMC5n: Count operation stop, clear & start mode on match between TM5n and CR5n
LVS5n 1 0 LVR5n 0 1 Timer Output F/F Status Setting High-level output Low-level output
Timer output F/F reverse enable Timer output enable TOE5n = 1 (TMC5n = 00001011B or 00000111B) <2> After TCE5n = 1 is set, the count operation starts. <3> Timer output F/F is reversed by match between TM5n and CR5n. After INTTM5n is generated, TM5n is cleared to 00H. <4> Timer output F/F is reversed at the same interval and a square wave is output from TO5n. The frequency is as follows. * Frequency = 1/2t (N + 1) (N = 00H to FFH) Note 8-bit timer/event counter 50: P72, PM72 8-bit timer/event counter 51: P73, PM73 Remark n = 0, 1
200
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-12. Square-Wave Output Operation Timing
t Count clock
TM5n count value
00H
01H
02H
N-1
N
00H
01H
02H
N-1
N
00H
Count start CR5n N
TO5nNote
Note The TO5n output initial value can be set by bits 2 and 3 (LVR5n, LVS5n) of 8-bit timer mode control register 5n (TMC5n). Remarks 1. N = 00H to FFH 2. n = 0, 1 9.4.4 8-bit PWM output operation The 8-bit timer/event counter operates as PWM output when bit 6 (TMC5n6) of 8-bit timer mode control register 5n (TMC5n) is set to 1. The duty ratio pulse is determined by the value set to 8-bit timer compare register 5n (CR5n). Set the active level width of the PWM pulse to CR5n. The active level can be selected with bit 1 (TMC5n1) of TMC5n. The count clock can be selected with bits 0 to 2 (TCL5n0 to TCL5n2) of timer clock select register 5n (TCL5n). PWM output enable/disable can be selected with bit 0 (TOE5n) of TMC5n. Caution CR5n can be rewritten in PWM mode only once per cycle.
Remark n = 0, 1
User's Manual U14260EJ3V1UD
201
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
(1) PWM output basic operation Setting <1> Set each register. * * * * Set port output latches (P72, P73)Note and port mode registers (PM72, PM73)Note to 0. TCL5n: Count clock selection CR5n: Compare value TMC5n: Count operation stop, PWM mode selection, timer output F/F not changed
TMC5n1 0 1 Active Level Selection Active high Active low
Timer output enabled (TMC5n = 01000001B or 01000011B) <2> When TCE5n = 1 is set, the count operation is started. To stop the count operation, set TCE5n to 0. Note 8-bit timer/event counter 50: P72, PM72 8-bit timer/event counter 51: P73, PM73 PWM output operation <1> PWM output (output from TO5n) outputs an inactive level until an overflow occurs. <2> When an overflow occurs, the active level is output. The active level is output until CR5n matches the count value of 8-bit timer counter 5n (TM5n). <3> When CR5n matches the count value, the inactive level is output. The inactive level is output until an overflow occurs again. <4> Operations <2> and <3> are repeated until the count operation stops. <5> When the count operation is stopped by setting TCE5n = 0, PWM output becomes the inactive level. For details of timing, see Figures 9-13 and 9-14. The cycle, active-level width, and duty are as follows. * Cycle = 28t * Active-level width = Nt * Duty = N/28 (N = 00H to FFH) Remark n = 0, 1
202
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
Figure 9-13. PWM Output Operation Timing (a) Basic operation (active level = H)
t Count clock TM5n CR5n TCE5n INTTM5n TO5n <1> <2> Active level <3> Inactive level Active level <5> 00H 01H N FFH 00H 01H 02H N N+1 FFH 00H 01H 02H M 00H
(b) CR5n = 0
t Count clock TM5n CR5n TCE5n INTTM5n TO5n L Inactive level Inactive level 00H 01H 00H FFH 00H 01H 02H N N+1 N+2 FFH 00H 01H 02H M 00H
(c) CR5n = FFH
t Count clock TM5n CR5n TCE5n INTTM5n TO5n Inactive level Active level Active level Inactive level Inactive level 00H 01H FFH FFH 00H 01H 02H N N+1 N+2 FFH 00H 01H 02H M 00H
Remarks 1. <1> to <3> and <5> in Figure 9-13 (a) correspond to <1> to <3> and <5> in PWM output operation in 9.4.4 (1) PWM output basic operation. 2. n = 0, 1
User's Manual U14260EJ3V1UD
203
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
(2) Operation with CR5n changed Figure 9-14. Timing of Operation with CR5n Changed (a) CR5n value is changed from N to M before clock rising edge of FFH Value is transferred to CR5n at overflow immediately after change.
t Count clock TM5n CR5n TCE5n INTTM5n TO5n <2> <1> CR5n change (N M) H N N+1 N+2 N FFH 00H 01H 02H M M M+1 M+2 FFH 00H 01H 02H M M+1 M+2
(b) CR5n value is changed from N to M after clock rising edge of FFH Value is transferred to CR5n at second overflow.
t Count clock TM5n CR5n TCE5n INTTM5n TO5n <1> CR5n change (N M) <2> H N N+1 N+2 N FFH 00H 01H 02H N N N+1 N+2 FFH 00H 01H 02H M M M+1 M+2
Caution
When reading from CR5n between <1> and <2> in Figure 9-14, the value read differs from the actual value (read value: M, actual value of CR5n: N).
Remark n = 0, 1
204
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.4.5 Interval timer (16-bit) operations When bit 4 (TMC514) of 8-bit timer mode control register 51 (TMC51) is set to 1, the 16-bit resolution timer/counter mode is entered. The 8-bit timer/event counter operates as an interval timer that generates interrupt requests repeatedly at intervals of the count value preset to the 8-bit timer compare registers (CR50, CR51). Setting <1> Set each register. * TCL50: * CR50, CR51: Select count clock for TM50. Cascade-connected TM51 need not be selected. Compare value (each value can be set to 00H to FFH) CR51). TM50 TMC50 = 0000xxx0B x: don't care TM51 TMC51 = 0001xxx0B x: don't care <2> When TMC51 is set to TCE51 = 1 and then TMC50 is set to TCE50 = 1, the count operation starts. <3> When the values of TM50 and CR50 of the cascade-connected timer match, INTTM50 of TM50 is generated (TM50 and TM51 are cleared to 00H). <4> INTTM5n is generated repeatedly at the same interval. Cautions 1. Stop the timer operation without fail before setting the compare registers (CR50, CR51). 2. INTTM51 of TM51 is generated when the TM51 count value matches CR51, even if cascade connection is used. Be sure to mask TM51 to disable interrupts. 3. Set TCE50 and TCE51 in order of TM51 then TM50. 4. Count restart/stop can only be controlled by setting TCE50 of TM50 to 1/0. Figure 9-15 shows an example of 16-bit resolution cascade connection mode timing. Figure 9-15. 16-Bit Resolution Cascade Connection Mode * TMC50, TMC51: Select the clear & start mode entered on a match between TM50 and CR50 (TM51 and
Count clock TM50 TM51 CR50 CR51 TCE50 TCE51 INTTM50 Interval time Operation enable Count start Interrupt request generation, counter clear Operation stop 00H 00H N M 01H N N+1 FFH 00H 01H FFH 00H 02H FFH 00H 01H M-1 M N 00H 01H 00H A 00H B 00H
User's Manual U14260EJ3V1UD
205
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.5 Program List
Caution The following sample program is shown as an example to describe the operation of semiconductor products and their applications. Therefore, when applying the following information to your devices, design the devices after performing evaluation under your own responsibility. 9.5.1 Interval timer (8-bit)
/*************************************************************************************/ /* */ /* Timer 50 operation sample */ /* Interval timer setting example (frequency change by interrupt processing) */ /* data[0]: Data set flag (value changed when other than 00) */ /* data[1]: Set data */ /* */ /*************************************************************************************/ #pragma sfr #pragma EI #pragma DI #pragma interrupt INTTM50 intervalint rb2 unsigned char data[2]; /* Data area */ void main(void) { PCC = 0x0; data[0] = 0; data[1] = 0;
/* Set high-speed operation mode */ /* Clear data area */
P7 = 0b11111011; PM7.2 = 0;
/* Set port */ /* When using TO50 */ /* Set P72 to output */ /* /* /* /* /* /* /* /* Set interrupt */ Clear INTTM50 interrupt mask */ Set timer 50 */ Clear & start mode, initial value L */ Both rising and falling edges */ Count clock is fx/2^6 */ Set interval to 1 ms as initial value */ Timer start */
TMMK50 = 0; TMC50 = 0b00000111; TCL50 = 0b00000101; CR50 = 131; TCE50 = 1; EI(); while(1); } /* INTTM50 interrupt function */ void intervalint() { if(data[0] != 0) { CR50 = data[1]; data[0] = 0; } }
/* Dummy loop */
/* Set new set value */ /* Clear request flag */
206
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.5.2 External event counter
/***************************************************************/ /* */ /* Timer 50 operation sample */ /* Event counter setting example */ /* data: Count up flag */ /* */ /***************************************************************/ #pragma sfr #pragma EI #pragma DI #pragma interrupt INTTM50 intervalint rb2 unsigned char data; /* Data area */ void main(void) { PCC = 0x0; data = 0;
/* Set high-speed operation mode */ /* Clear data area */ /* Set port /* Set P72 to input */ /* /* /* /* /* /* /* */
PM7.2 = 1;
TMMK50 = 0; TMC50 = 0b00000000; TCL50 = 0b00000001; CR50 = 0x10; TCE50 = 1; EI();
Set interrupt Clear INTTM50 interrupt mask Set timer 50 Clear & start mode Specify rising edge of TI50 Set N = 16 as initial value Timer start
*/ */ */ */ */ */ */
/*************************************************************/ /* */ /* Describe the processing to be executed */ /* */ /*************************************************************/ while(data == 0); /* Wait for count up */
/*************************************************************/ /* */ /* Describe the processing after count up below */ /* */ /*************************************************************/ } /* INTTM50 interrupt function */ void intervalint() { data = 0xff; TCE50 = 0; }
/* Set count up flag /* Timer stop
*/ */
User's Manual U14260EJ3V1UD
207
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.5.3 Interval timer (16-bit)
/***************************************************************/ /* */ /* Timer 5 operation sample */ /* Cascade connection setting example */ /* */ /***************************************************************/ #pragma sfr #pragma EI #pragma DI #define intervalTM5 130 /* Cycle data to be set to CR */ #pragma interrupt INTTM50 ppgint rb2 unsigned char ppgdata[2]; /* Data area to be set to timer 5 */ void main(void) { int interval; interval = intervalTM5; PCC = 0x0; ppgdata[0] = 0; ppgdata[1] = 0; P7 = 0b11111011; PM7.2 = 0; TMMK50 = 0; TMMK51 = 1; TCL50 = 0b00000101; CR50 = interval & 0xff; CR51 = interval >> 8; TMC50 = 0b00000111; TMC51 = 0b00010000; TCE51 = 1; TCE50 = 1; EI(); while(1); } /* Timer 5 interrupt function */ void ppgint() { unsigned int work; work = ppgdata[0]+ppgdata[1]*0x100; if (work != 0) { TCE50 =0; CR51 = work >> 8; CR50 = work & 0xff; ppgdata[0] = 0; ppgdata[1] = 0; if (work != 0xffff) { TCE50 = 1; } } }
/* /* /* /* /* /* /* /* /* /* /* /* /* /* /*
Select high-speed operation mode */ Clear CR50 data */ Clear CR51 data */ Set port */ Clear P72 */ Set P72 to output */ Set interrupt */ Clear INTTM50 interrupt mask */ Set INTTM51 interrupt mask */ Set timer 5 */ Count clock is fx/2^6 */ Set lower compare register to CR50 */ Set higher compare register to CR51 */ Inverted on match, initial value L */ Cascade mode */
/* Timer starts */
/* Timer resumes */
208
User's Manual U14260EJ3V1UD
CHAPTER 9
8-BIT TIMER/EVENT COUNTERS 50, 51
9.6 Cautions for 8-Bit Timer/Event Counters 50, 51
(1) Timer start errors An error of up to one clock may occur in the time required for a match signal to be generated after timer start. This is because 8-bit timer counter 5n (TM5n) is started asynchronously to the count pulse. Figure 9-16. Start Timing of 8-Bit Timer Counter 5n (TM5n)
Count pulse TM5n count value 00H
Timer start
01H
02H
03H
04H
(2) Setting STOP mode or main system clock stop mode Except when TI5n input is selected, always set TCE5n = 0 before setting the STOP mode or main system clock stop mode. The timer may malfunction when the main system clock starts oscillating. (3) TM5n (n = 0, 1) reading during timer operation When reading TM5n during operation, the count clock stops temporarily, so select a count clock with a high/lowlevel waveform longer than two cycles of the CPU clock. For example, in the case where the CPU clock (fCPU) is fx, when the selected count clock is fx/4 or below, it can be read. Remark n = 0, 1
User's Manual U14260EJ3V1UD
209
CHAPTER 10
WATCH TIMER
10.1 Watch Timer Functions
The watch timer has the following functions. (1) Watch timer When the main system clock or subsystem clock is used, interrupt requests (INTWT) are generated at 214/fW second or 25/fW second intervals. (2) Interval timer Interrupt requests (INTWTI) are generated at the preset time interval. For the interval time, refer to Table 10-2. The watch timer and the interval timer can be used simultaneously. Figure 10-1 shows the watch timer block diagram. Figure 10-1. Watch Timer Block Diagram
Selector
fWX
5-bit counter Clear
INTWT
Clear
Selector
fX/27 fXT
fW fW 24
9-bit prescaler fW 25 fW 26 fW 27 fW 28 fW 29
Selector
INTWTI
WTM7 WTM6 WTM5 WTM4 WTM3 WTM1 WTM0 Watch timer operation mode register (WTM) Internal bus
Remark fW: Watch timer clock frequency (fX/27 or fXT) fX: Main system clock oscillation frequency fXT: Subsystem clock oscillation frequency fWX: fW or fW/29
210
User's Manual U14260EJ3V1UD
CHAPTER 10
WATCH TIMER
10.2 Watch Timer Configuration
The watch timer consists of the following hardware. Table 10-1. Watch Timer Configuration
Item Counter Prescaler Control register 5 bits x 1 9 bits x 1 Watch timer operation mode register (WTM) Configuration
10.3 Register to Control Watch Timer
The watch timer is controlled by the watch timer operation mode register (WTM). * Watch timer operation mode register (WTM) This register sets the watch timer count clock, enables/disables operation, sets the prescaler interval time, controls the 5-bit counter operation, and sets the watch timer interrupt request time. WTM is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears WTM to 00H.
User's Manual U14260EJ3V1UD
211
CHAPTER 10
WATCH TIMER
Figure 10-2. Format of Watch Timer Operation Mode Register (WTM)
Address: FF41H Symbol WTM 7 WTM7 After reset: 00H 6 WTM6 R/W 5 WTM5 4 WTM4 3 WTM3 2 0 1 WTM1 0 WTM0
WTM7 0 1
Watch timer count clock selection fX/27 (65.4 kHz: fX = 8.38 MHz, 93.7 kHz: fX = 12 MHzNote) fXT (32.768 kHz: fXT = 32.768 kHz)
WTM6 0 0 0 0 1 1
WTM5 0 0 1 1 0 0
WTM4 0 1 0 1 0 1 24/fW 25/fW 26/fW 27/fW 28/fW 29/fW
Prescaler interval time selection
Other than above
Setting prohibited
WTM3 0 1 WTM1 0 1 WTM0 0 1 Clear after operation stop Start 214/fW 25/fW
Interrupt request time of watch timer
5-bit counter operation control
Watch timer operation enable Operation stopped (both prescaler and timer cleared) Operation enabled
Note Expanded-specification products of PD780078 Subseries only. Caution Do not change the count clock, interval time, and interrupt request time (by using bits 3 to 7 (WTM3 to WTM7) of WTM) while the watch timer is operating. Remarks 1. fW: Watch timer clock frequency (fX/27 or fXT) 2. fX: Main system clock oscillation frequency 3. fXT: Subsystem clock oscillation frequency
212
User's Manual U14260EJ3V1UD
CHAPTER 10
WATCH TIMER
10.4 Watch Timer Operations
10.4.1 Watch timer operation The watch timer generates an interrupt request (INTWT) at specific time intervals (214/fW seconds or 25 /fW seconds) by using the main system clock or subsystem clock. The interrupt request is generated at the following time intervals (where WTM3 = 0). * If main system clock (8.38 MHz) is selected: 0.25 seconds * If subsystem clock (32.768 kHz) is selected: 0.5 seconds When bit 0 (WTM0) and bit 1 (WTM1) of the watch timer operation mode register (WTM) are set to 1, the count operation starts, and when these bits are set to 0, the 5-bit counter is cleared and the count operation stops. When the interval timer is simultaneously operated, a zero-second start can be achieved for the watch timer by setting WTM1 to 1 after clearing it to 0. In this case, however, the 9-bit prescaler is not cleared. Therefore, an error up to 29/fW seconds occurs in the first overflow (INTWT) after the zero-second start. Remark fW: Watch timer clock frequency (fX/27 or fXT) 10.4.2 Interval timer operation The watch timer operates as interval timer that generates interrupt requests (INTWTI) repeatedly at an interval of the preset count value. The interval time can be selected with bits 4 to 6 (WTM4 to WTM6) of the watch timer operation mode register (WTM). When bit 0 (WTM0) of WTM is set to 1, the count operation starts. When this bit is cleared to 0, the count operation stops. Table 10-2. Interval Timer Interval Time
Interval Time 24/fW 25 /fW 26 /fW 27/fW 28/fW 29/fW When Operated at fX = 12 MHzNote 170 s 341 s 682 s 1.36 ms 2.73 ms 5.46 ms When Operated at fX = 8.38 MHz 244 s 488 s 977 s 1.95 ms 3.91 ms 7.82 ms When Operated at fX = 4.19 MHz 488 s 977 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms When Operated at fXT = 32.768 kHz 488 s 976 s 1.95 ms 3.90 ms 7.81 ms 15.6 ms
WTM6 0 0 0 0 1 1
WTM5 0 0 1 1 0 0
WTM4 0 1 0 1 0 1
Other than above
Setting prohibited
Note Expanded-specification products of PD780078 Subseries only. Remark fW: Watch timer clock frequency (fX/27 or fXT) fX: Main system clock oscillation frequency fXT: Subsystem clock oscillation frequency
User's Manual U14260EJ3V1UD
213
CHAPTER 10
WATCH TIMER
Figure 10-3. Operation Timing of Watch Timer/Interval Timer
5-bit counter 0H Start Count clock Watch timer interrupt INTWT Interval timer interrupt INTWTI Interrupt time of watch timer (214/fW or 25/fW sec.) Interrupt time of watch timer (214/fW or 25/fW sec.) Overflow Overflow
Interval time (T) nxT
T nxT
Remark fW: Watch timer clock frequency (fX/27 or fXT) n: The number of interval timer operations
10.5 Cautions for Watch Timer
When operation of the watch timer and 5-bit counter is enabled by the watch timer operation mode register (WTM) (by setting bits 0 (WTM0) and 1 (WTM1) of WTM to 1), the interval until the first interrupt request (INTWT) is generated after the register is set does not exactly match the specification made with bit 3 (WTM3) of WTM. This is because there is a delay of one 11-bit prescaler output cycle until the 5-bit counter starts counting. Subsequently, however, the INTWT signal is generated at the specified intervals. Figure 10-4. Example of Generation of Watch Timer Interrupt Request (INTWT) (When Interrupt Period = 0.5 s) It takes 0.515625 seconds for the first INTWT to be generated (29 x 1/32768 = 0.015625 s longer). INTWT is then generated every 0.5 seconds.
WTM0, WTM1 0.515625 s 0.5 s 0.5 s
INTWT
214
User's Manual U14260EJ3V1UD
CHAPTER 11
WATCHDOG TIMER
11.1 Watchdog Timer Functions
The watchdog timer has the following functions. (1) Watchdog timer The watchdog timer detects a program loop. Upon detection of a program loop, a non-maskable interrupt request or RESET can be generated. For the loop detection time, refer to Table 11-2. (2) Interval timer Interrupt requests are generated at the preset time intervals. For the interval time, refer to Table 11-3. Caution Select the watchdog timer mode or the interval timer mode using the watchdog timer mode register (WDTM). (The watchdog timer and the interval timer cannot be used simultaneously.) Figure 11-1 shows a block diagram of the watchdog timer. Figure 11-1. Watchdog Timer Block Diagram
fX Clock input controller Divided clock selector
fX/28
Divider circuit
Output controller
INTWDT RESET
RUN
Division mode selector
3 WDT mode signal
WDCS2 WDCS1 WDCS0 Watchdog timer clock select register (WDCS)
RUN WDTM4 WDTM3
Watchdog timer mode register (WDTM) Internal bus
User's Manual U14260EJ3V1UD
215
CHAPTER 11
WATCHDOG TIMER
11.2 Watchdog Timer Configuration
The watchdog timer consists of the following hardware. Table 11-1. Watchdog Timer Configuration
Item Control registers Configuration Watchdog timer clock select register (WDCS) Watchdog timer mode register (WDTM)
11.3 Registers to Control Watchdog Timer
The following two registers are used to control the watchdog timer. * Watchdog timer clock select register (WDCS) * Watchdog timer mode register (WDTM) (1) Watchdog timer clock select register (WDCS) This register sets the overflow time of the watchdog timer and the interval timer. WDCS is set by an 8-bit memory manipulation instruction. RESET input clears WDCS to 00H. Figure 11-2. Format of Watchdog Timer Clock Select Register (WDCS)
Address: FF42H Symbol WDCS 7 0 After reset: 00H 6 0 R/W 5 0 4 0 3 0 2 WDCS2 1 WDCS1 0 WDCS0
WDCS2
WDCS1
WDCS0
Overflow time of watchdog timer/interval timer fX = 8.38 MHz fX = 12 MHzNote 341 s 682 s 1.36 ms 2.73 ms 5.46 ms 10.9 ms 21.8 ms 87.3 ms
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
212/fX 213/fX 214/fX 215/fX 216/fX 217/fX 218/fX 220/fX
488 s 977 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms 31.2 ms 125 ms
Note Expanded-specification products of PD780078 Subseries only. Remark fX: Main system clock oscillation frequency
216
User's Manual U14260EJ3V1UD
CHAPTER 11
WATCHDOG TIMER
(2) Watchdog timer mode register (WDTM) This register sets the watchdog timer operating mode and enables/disables counting. WDTM is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears WDTM to 00H. Figure 11-3. Format of Watchdog Timer Mode Register (WDTM)
Address: FFF9H Symbol WDTM 7 RUN RUN 0 1 Count stop Counter is cleared and counting starts After reset: 00H 6 0 R/W 5 0 4 WDTM4 3 WDTM3 2 0 1 0 0 0
Watchdog timer operation mode selectionNote 1
WDTM4 0
WDTM3 x 0
Watchdog timer operation mode selectionNote 2 Interval timer modeNote 3 (Maskable interrupt request occurs upon generation of overflow) Watchdog timer mode 1 (Non-maskable interrupt request occurs upon generation of overflow) Watchdog timer mode 2 (Reset operation is activated upon generation of overflow)
1
1
1
Notes 1. Once set to 1, RUN cannot be cleared to 0 by software. Thus, once counting starts, it can only be stopped by RESET input. 2. Once set to 1, WDTM3 and WDTM4 cannot be cleared to 0 by software. 3. The watchdog timer starts operation as an interval timer when RUN is set to 1. Caution When RUN is set to 1 so that the watchdog timer is cleared, the actual overflow time is up to 28/fX seconds shorter than the time set by the watchdog timer clock select register (WDCS). Remark x: Don't care
User's Manual U14260EJ3V1UD
217
CHAPTER 11
WATCHDOG TIMER
11.4 Watchdog Timer Operations
11.4.1 Watchdog timer operation When bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 1, the watchdog timer is operated to detect a program loop. The loop detection time interval is selected with bits 0 to 2 (WDCS0 to WDCS2) of the watchdog timer clock select register (WDCS). The watchdog timer starts by setting bit 7 (RUN) of WDTM to 1. After the watchdog timer is started, set RUN to 1 within the set loop time interval. The watchdog timer can be cleared and counting started by setting RUN to 1. If RUN is not set to 1 and the loop detection time is exceeded, system reset or a non-maskable interrupt request is generated according to the value of bit 3 (WDTM3) of WDTM. The watchdog timer continues operating in the HALT mode but it stops in the STOP mode. Thus, set RUN to 1 before the STOP mode is set, clear the watchdog timer and then execute the STOP instruction. Cautions 1. The actual loop detection time may be shorter than the set time by up to 28/fX seconds. 2. When the subsystem clock is selected for the CPU clock, the watchdog timer count operation is stopped. Table 11-2. Watchdog Timer Loop Detection Time
Loop Detection Time 212/fX 213/fX 214/fX 215/fX 216/fX 217/fX 218/fX 220/fX When Operated at fX = 8.38 MHz 488 s 977 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms 31.2 ms 125 ms When Operated at fX = 12 MHzNote 341 s 682 s 1.36 ms 2.73 ms 5.46 ms 10.9 ms 21.8 ms 87.3 ms
Note Expanded-specification products of PD780078 Subseries only. Remark fX: Main system clock oscillation frequency
218
User's Manual U14260EJ3V1UD
CHAPTER 11
WATCHDOG TIMER
11.4.2 Interval timer operation The watchdog timer operates as an interval timer that generates interrupt requests repeatedly at an interval of the preset count value when bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 0. The interval time of the interval timer is selected with bits 0 to 2 (WDCS0 to WDCS2) of the watchdog timer clock select register (WDCS). When bit 7 (RUN) of WDTM is set to 1, the watchdog timer operates as an interval timer. When the watchdog timer operates as an interval timer, the interrupt mask flag (WDTMK) and priority specification flag (WDTPR) are validated and the maskable interrupt request (INTWDT) can be generated. Among the maskable interrupts, INTWDT has the highest priority at default. The interval timer continues operating in the HALT mode but it stops in STOP mode. Thus, set RUN to 1 before the STOP mode is set, clear the interval timer and then execute the STOP instruction. Cautions 1. Once bit 4 (WDTM4) of WDTM is set to 1 (this selects the watchdog timer mode), the interval timer mode is not set unless RESET is input. 2. The interval time just after setting WDTM may be shorter than the set time by up to 28/fX seconds. 3. When the subsystem clock is selected for the CPU clock, the watchdog timer count operation is stopped. Table 11-3. Interval Timer Interval Time
Interval Time 212/fX 213/fX 214/fX 215/fX 216/fX 217/fX 218/fX 220/fX When Operated at fX = 8.38 MHz 488 s 977 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms 31.2 ms 125 ms When Operated at fX = 12 MHzNote 341 s 682 s 1.36 ms 2.73 ms 5.46 ms 10.9 ms 21.8 ms 87.3 ms
Note Expanded-specification products of PD780078 Subseries only. Remark fX: Main system clock oscillation frequency
User's Manual U14260EJ3V1UD
219
CHAPTER 12
CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
12.1 Clock Output/Buzzer Output Controller Functions
Clock output is used for carrier output during remote controlled transmission and clock output for supply to peripheral ICs. The clock selected by the clock output select register (CKS) is output. In addition, buzzer output is used for square-wave output of the buzzer frequency selected by CKS. Figure 12-1 shows the block diagram of the clock output/buzzer output controller. Figure 12-1. Block Diagram of Clock Output/Buzzer Output Controller
fX
Prescaler 8 4 fX/210 to fX/213
Selector
BUZ/TI001/ TO01/P75 BCS0, BCS1
BZOE fX to fX/27
Selector
Output latch (P75)
PM75 PCL/TI011/ P74
Clock controller
fXT
CLOE Output latch (P74) BZOE BCS1 BCS0 CLOE CCS3 CCS2 CCS1 CCS0 PM74
Clock output select register (CKS) Internal bus
220
User's Manual U14260EJ3V1UD
CHAPTER 12
CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
12.2 Configuration of Clock Output/Buzzer Output Controller
The clock output/buzzer output controller consists of the following hardware. Table 12-1. Configuration of Clock Output/Buzzer Output Controller
Item Control registers Configuration Clock output select register (CKS) Port mode register (PM7) Port register 7 (P7)
12.3 Registers to Control Clock Output/Buzzer Output Controller
The following three registers are used to control the clock output/buzzer output controller. * Clock output select register (CKS) * Port mode register (PM7) * Port register 7 (P7) (1) Clock output select register (CKS) This register sets output enable/disable for clock output (PCL) and for the buzzer frequency output (BUZ), and sets the output clock. CKS is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CKS to 00H.
User's Manual U14260EJ3V1UD
221
CHAPTER 12
CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
Figure 12-2. Format of Clock Output Select Register (CKS)
Address: FF40H After reset: 00H R/W Symbol CKS 7 BZOE 6 BCS1 5 BCS0 4 CLOE 3 CCS3 2 CCS2 1 CCS1 0 CCS0
BZOE 0 1
BUZ output enable/disable specification Stop clock divider operation. BUZ fixed to low level. Enable clock divider operation. BUZ output enabled.
BCS1
BCS0
BUZ output clock selection fX = 8.38 MHz fX = 12 MHzNote 11.7 kHz 5.85 kHz 2.92 kHz 1.46 kHz
0 0 1 1
0 1 0 1
fX/210 fX/211 fX/212 fX/213
8.18 kHz 4.09 kHz 2.04 kHz 1.02 kHz
CLOE 0 1
PCL output enable/disable specification Stop clock divider operation. PCL fixed to low level. Enable clock divider operation. PCL output enabled.
CCS3
CCS2
CCS1
CCS0
PCL output clock selection fX = 8.38 MHz fX = 12 MHzNote 12 MHz 6 MHz 3 MHz 1.5 MHz 750 kHz 375 kHz 187 kHz 93.7 kHz
0 0 0 0 0 0 0 0 1
0 0 0 0 1 1 1 1 0
0 0 1 1 0 0 1 1 0
0 1 0 1 0 1 0 1 0
fX fX/2 fX/22 fX/23 fX/24 fX/25 fX/26 fX/27
8.38 MHz 4.19 MHz 2.09 MHz 1.04 MHz 523 kHz 261 kHz 130 kHz 65.4 kHz
fXT (32.768 kHz) Setting prohibited
Other than above
Note Expanded-specification products of PD780078 Subseries only. Remarks 1. fX: Main system clock oscillation frequency 2. fXT: Subsystem clock oscillation frequency 3. Figures in parentheses are for operation with fXT = 32.768 kHz.
222
User's Manual U14260EJ3V1UD
CHAPTER 12
CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
(2) Port mode register 7 (PM7) This register sets port 7 input/output in 1-bit units. When using the P74/PCL/TI011 pin for clock output and the P75/BUZ/TI001/TO01 pin for buzzer output, set PM74 and PM75, and the output latches of P74 and P75 to 0. PM7 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM7 to FFH. Figure 12-3. Format of Port Mode Register 7 (PM7)
Address: FF27H Symbol PM7 7 1 After reset: FFH 6 1 5 PM75 R/W 4 PM74 3 PM73 2 PM72 1 PM71 0 PM70
PM7n 0 1
P7n pin I/O mode selection (n = 0 to 5) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
223
CHAPTER 12
CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER
12.4 Operation of Clock Output/Buzzer Output Controller
12.4.1 Operation as clock output The clock pulse is output using the following procedure. <1> Select the clock pulse output frequency using bits 0 to 3 (CCS0 to CCS3) of the clock output select register (CKS) (clock pulse output in disabled state). <2> Set bit 4 (CLOE) of CKS to 1, and enable clock output. Remark The clock output controller is designed not to output pulses with a small width during output enable/ disable switching of the clock output. As shown in Figure 12-4, be sure to start output from the low period of the clock (marked with * in the figure). When stopping output, do so after securing the high level of the clock. Figure 12-4. Remote Control Output Application Example
CLOE * Clock output *
12.4.2 Operation as buzzer output The buzzer frequency is output using the following procedure. <1> Select the buzzer output frequency using bits 5 and 6 (BCS0, BCS1) of the clock output select register (CKS) (buzzer output in disabled state). <2> Set bit 7 (BZOE) of CKS to 1 to enable buzzer output.
224
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
13.1 A/D Converter Functions
The A/D converter is a 10-bit resolution converter that converts analog inputs into digital signals. It can control up to 8 analog input channels (ANI0 to ANI7). (1) Hardware start Conversion is started by trigger input (ADTRG: rising edge, falling edge, or both rising and falling edges can be specified). (2) Software start Conversion is started by setting A/D converter mode register 0 (ADM0). Select one channel for analog input from ANI0 to ANI7 to start A/D conversion. In the case of hardware start, the A/D converter stops when A/D conversion is completed, and an interrupt request (INTAD0) is generated. In the case of software start, A/D conversion is repeated. Each time an A/D conversion operation ends, an interrupt request (INTAD0) is generated. Figure 13-1. Block Diagram of 10-Bit A/D Converter
AVREF ADCS bit
Sample & hold circuit
ANI0/P10 ANI1/P11 ANI2/P12 ANI3/P13 ANI4/P14 ANI5/P15 ANI6/P16 ANI7/P17
Tap selector
Voltage comparator
Selector
Successive approximation register (SAR)
AVSS
ADTRG/INTP3/P03
Edge detector
Controller
INTAD0 INTP3
3
Edge detector Trigger Note enable
A/D conversion result register 0 (ADCR0)
ADS02 ADS01 ADS00
ADCS0 TRG0 FR02 FR01 FR00 EGA01 EGA00 ADCE0
Analog input channel specification register 0 (ADS0) Internal bus
A/D converter mode register 0 (ADM0)
Note The valid edge of an external interrupt is specified by bit 3 of the EGP and EGN registers (see Figure 195 Format of External Interrupt Rising Edge Enable Register (EGP), External Interrupt Falling Edge Enable Register (EGN)).
User's Manual U14260EJ3V1UD
225
CHAPTER 13
A/D CONVERTER
13.2 A/D Converter Configuration
The A/D converter consists of the following hardware. Table 13-1. Registers of A/D Converter Used on Software
Item Registers Configuration Successive approximation register (SAR) A/D conversion result register 0 (ADCR0) A/D converter mode register 0 (ADM0) Analog input channel specification register 0 (ADS0)
(1) ANI0 to ANI7 pins These are the analog input pins of the 8-channel A/D converter. They input analog signals to be converted into digital signals. Pins other than the one selected as the analog input pin by the analog input channel specification register 0 (ADS0) can be used as input port pins. Cautions 1. Use ANI0 to ANI7 input voltages within the specification range. If a voltage higher than or equal to AVREF or lower than or equal to AVSS is applied (even if within the absolute maximum rating range), the conversion value of that or equal to channel will be undefined and the conversion values of other channels may also be affected. 2. Analog input (ANI0 to ANI7) pins are alternate-function pins that can also be used as input port pins (P10 to P17). When A/D conversion is performed by selecting any one of ANI0 to ANI7, do not access port 1 during conversion, as this may cause a lower conversion resolution. 3. When a digital pulse is applied to a pin adjacent to the pin in the process of A/D conversion, A/D conversion values may not be obtained as expected due to coupling noise. Thus, do not apply a pulse to a pin adjacent to the pin in the process of A/D conversion. (2) Sample & hold circuit The sample & hold circuit samples the input signal of the analog input pin selected by the selector when A/D conversion is started, and holds the sampled analog input voltage value during A/D conversion. (3) Series resistor string The series resistor string is connected between AVREF and AVSS, and generates a voltage to be compared with the analog input signal. Figure 13-2. Circuit Configuration Diagram of Series Resistor String
AVREF
P-ch
ADCS0
Series resistor string AVSS
226
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(4) Voltage comparator The voltage comparator compares the sampled analog input voltage and the output voltage of the series resistor string. (5) Successive approximation register (SAR) This register compares the sampled analog voltage and the voltage of the series resistor string, and converts the result, starting from the most significant bit (MSB). When the voltage value is converted into a digital value down to the least significant bit (LSB) (end of A/D conversion), the contents of the SAR register are transferred to A/D conversion result register 0 (ADCR0). (6) A/D conversion result register 0 (ADCR0) The result of A/D conversion is loaded from the successive approximation register (SAR) to this register each time A/D conversion is completed, and the ADCR0 register holds the result of A/D conversion in its higher 10 bits (the lower 6 bits are fixed to 0). (7) Controller After A/D conversion has been completed, INTAD0 is generated. (8) AVREF pin This pin inputs an analog power/reference voltage to the A/D converter. When using the A/D converter, supply the power. Connect directly to VSS0 or VSS1 when the A/D converter is not used. The signal input to ANI0 to ANI7 is converted into a digital signal, based on the voltage applied across AVREF and AVSS. Caution A series resistor string is connected between the AVREF and AVSS pins. Therefore, when the output impedance of the reference voltage is too high, it seems as if the AVREF pin and the series resistor string are connected in series. This may cause a greater reference voltage error. (9) AVSS pin This is the ground potential pin of the A/D converter. Always use this pin at the same potential as that of the VSS pin even when the A/D converter is not used. (10) ADTRG pin This pin is used to start the A/D converter by hardware. (11) A/D converter mode register 0 (ADM0) This register is used to set the conversion time of the analog input signal to be converted, and to start or stop the conversion operation. (12) Analog input channel specification register 0 (ADS0) This register is used to specify the port that inputs the analog voltage to be converted into a digital signal.
User's Manual U14260EJ3V1UD
227
CHAPTER 13
A/D CONVERTER
13.3 Registers Used in A/D Converter
The A/D converter uses the following three registers. * A/D converter mode register 0 (ADM0) * Analog input channel specification register 0 (ADS0) * A/D conversion result register 0 (ADCR0) (1) A/D converter mode register 0 (ADM0) This register sets the conversion time for the analog input to be A/D converted, conversion start/stop, and the external trigger. ADM0 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears ADM0 to 00H.
228
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
Figure 13-3. Format of A/D Converter Mode Register 0 (ADM0)
Address: FF80H After reset: 00H R/W Symbol ADM0 7 ADCS0 6 TRG0 5 FR02 4 FR01 3 FR00 2 EGA01 1 EGA00 0 ADCE0
ADCS0 0 1 Stop conversion operation.
A/D conversion operation control
Enable conversion operation.
TRG0 0 1 Software start Hardware start
Software start/hardware start selection
FR02
FR01
FR00
Conversion time selectionNote 1 fX = 8.38 MHz fX = 12 MHzNote 2 12.0 s 10.0 sNote 4 8.0 sNote 4 6.0 sNote 4 5.0 sNote 4 4.0 sNote 4
0 0 0 1 1 1
0 0 1 0 0 1
0 1 0 0 1 0
144/fX 120/fX 96/fX 72/fX 60/fX 48/fX Setting prohibited
17.1 s 14.3 s 11.4 sNote 3 8.5 sNote 3 7.1 sNote 3 5.7 sNote 3
Other than above
EGA01 0 0 1 1
EGA00 0 1 0 1
Edge specification of external trigger signal No edge detection Falling edge detection Rising edge detection Both falling and rising edge detection
ADCE0 0 1
Boost reference voltage generator for A/D converter circuit controlNote 5 Stop operation of boost reference voltage generator. Enable operation of boost reference voltage generator.
Notes 1. Set the A/D conversion time as follows. * When operated at fX = 12 MHz (VDD = 4.5 to 5.5 V): 12 s or more * When operated at fX = 8.38 MHz (VDD = 4.0 to 5.5 V): 14 s or more 2. Expanded-specification products of PD780078 Subseries only. 3. Setting is prohibited because the A/D conversion time is less than 14 s. 4. Setting is prohibited because the A/D conversion time is less than 12 s. 5. The on-chip booster is provided to realize low-voltage operation. The circuit that generates the reference voltage for boosting is controlled by ADCE0 and it takes 14 s for operation to stabilize after it is started. Therefore, by waiting for at least 14 s to elapse before setting ADCS0 to 1 after ADCE0 has been set to 1, the conversion results are valid from the first result. Remark fX: Main system clock oscillation frequency
User's Manual U14260EJ3V1UD
229
CHAPTER 13
A/D CONVERTER
Table 13-2. ADCS0 and ADCE0 Settings
ADCS0 0 0 1 1 ADCE0 0 1 0 1 A/D Conversion Operation Stop (DC power consumption path does not exist) Conversion wait mode (only the reference voltage generator consumes power) Conversion mode (the reference voltage generator stops operationNote) Conversion mode (the reference voltage generator operates)
Note
The first data immediately after A/D conversion has started must not be used. Figure 13-4. Timing Chart When Boost Reference Voltage Generator Is Used
Boost reference voltage generator: Operates ADCE0 Boost reference voltage Conversion operation ADCS0 Note Conversion wait Conversion operation Conversion stop
Note The time from the rising of the ADCE0 bit to the rising of the ADCS0 bit must be 14 s or longer to stabilize the reference voltage. Cautions 1. When rewriting FR00 to FR02 to other than the same data, stop A/D conversion once beforehand. 2. Before clearing ADCE0, clear ADCS0.
230
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(2) Analog input channel specification register 0 (ADS0) This register specifies the analog voltage input port for A/D conversion. ADS0 is set by an 8-bit memory manipulation instruction. RESET input clears ADS0 to 00H. Figure 13-5. Format of Analog Input Channel Specification Register 0 (ADS0)
Address: FF81H After reset: 00H R/W Symbol ADS0 7 0 6 0 5 0 4 0 3 0 2 ADS02 1 ADS01 0 ADS00
ADS02 0 0 0 0 1 1 1 1
ADS01 0 0 1 1 0 0 1 1
ADS00 0 1 0 1 0 1 0 1 ANI0 ANI1 ANI2 ANI3 ANI4 ANI5 ANI6 ANI7
Analog input channel specification
Caution
Be sure to clear bits 3 to 7 to 0.
(3) A/D conversion result register 0 (ADCR0) This is a 16-bit register that stores the A/D conversion results. The lower 6 bits are fixed to 0. Each time A/D conversion ends, the conversion result is loaded from the successive approximation register (SAR) and held by this register. The most significant bit (MSB) is stored in ADCR0 first. The higher 8 bits of the conversion results are stored in FF17H. The lower 2 bits of the conversion results are stored in FF16H. ADCR0 is read by a 16-bit memory manipulation instruction. RESET input sets ADCR0 to 0000H. Figure 13-6. Format of A/D Conversion Result Register 0 (ADCR0)
Address: FF16H, FF17H After reset: 0000H R FF17H Symbol ADCR0 0 0 0 0 0 0 FF16H
Caution
When A/D converter mode register 0 (ADM0) and analog input channel specification register 0 (ADS0) are written, the contents of ADCR0 may become undefined. Read the conversion result following conversion completion before writing to ADM0 and ADS0. Using a timing other than the above may cause an incorrect conversion result to be read.
User's Manual U14260EJ3V1UD
231
CHAPTER 13
A/D CONVERTER
13.4 A/D Converter Operation
13.4.1 Basic operations of A/D converter <1> Select one channel for A/D conversion using analog input channel specification register 0 (ADS0). <2> Set bit 0 (ADCE0) of A/D converter mode register 0 (ADM0) to 1 and wait for 14 s or longer. <3> Set bit 7 (ADCS0) of the ADM0 register to 1 to start the A/D conversion operation. (<4> to <10> are operations performed by hardware) <4> The voltage input to the selected analog input channel is sampled by the sample & hold circuit. <5> When sampling has been done for a certain time, the sample & hold circuit is placed in the hold state and the input analog voltage is held until the A/D conversion operation is finished. <6> Bit 9 of the successive approximation register (SAR) is set. The series resistor string voltage tap is set to (1/2) AVREF by the tap selector. <7> The voltage difference between the series resistor string voltage tap and analog input is compared by the voltage comparator. If the analog input is greater than (1/2) AVREF, the MSB of SAR remains set. If the analog input is smaller than (1/2) AVREF, the MSB is reset. <8> Next, bit 8 of SAR is automatically set, and the operation proceeds to the next comparison. The series resistor string voltage tap is selected according to the preset value of bit 9, as described below. * Bit 9 = 1: (3/4) AVREF * Bit 9 = 0: (1/4) AVREF The voltage tap and analog input voltage are compared and bit 8 of SAR is manipulated as follows. * Analog input voltage Voltage tap: Bit 8 = 1 * Analog input voltage < Voltage tap: Bit 8 = 0 <9> Comparison is continued in this way up to bit 0 of SAR. <10> Upon completion of the comparison of 10 bits, an effective digital result value remains in SAR, and the result value is transferred to and latched in A/D conversion result register 0 (ADCR0). At the same time, the A/D conversion end interrupt request (INTAD0) can also be generated. <11> Repeat steps <4> to <10>, until ADCS0 is cleared to 0. To stop the A/D converter, clear ADCS0 to 0. To restart A/D conversion from the status of ADCE0 = 1, start from <3>. To restart A/D conversion from the status of ADCE0 = 0, however, start from <2>. Cautions 1. If bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) is set to 1 without setting bit 0 (ADCE0) to 1, the first A/D conversion value immediately after A/D conversion has been started may not satisfy the rated value. Take measures such as polling the A/D conversion end interrupt request (INTAD0) and removing the first conversion results. The same may apply if ADCS0 is set to 1 without the lapse of a wait time of 14 s (MIN.) after ADCE0 has been set to 1. Make sure that the specified wait time elapses. 2. The A/D converter stops operation in standby mode.
232
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
Figure 13-7. Basic Operation of A/D Converter
Setting ADCS0 to 1, external trigger, or overwriting ADS0 A/D conversion start delay time Conversion time Sampling time
A/D converter operation
Sampling
A/D conversion
SAR Undefined
200H
300H or 100H
Conversion result
ADCR0
Conversion result
INTAD0
ADCS0
A/D conversion operations are performed continuously until bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) is reset (0) by software. If a write operation is performed to ADM0 or analog input channel specification register 0 (ADS0) during an A/D conversion operation, the conversion operation is initialized, and if ADCS0 is set (1), conversion starts again from the beginning. RESET input sets A/D conversion result register 0 (ADCR0) to 0000H. Confirm the conversion results by referring to the A/D conversion end interrupt request flag (ADIF0).
User's Manual U14260EJ3V1UD
233
CHAPTER 13
A/D CONVERTER
13.4.2 Input voltage and conversion results The relationship between the analog input voltage input to the analog input pins (ANI0 to ANI7) and the logical A/D conversion result (stored in A/D conversion result register 0 (ADCR0)) is shown by the following expression. VAIN AVREF
SAR = INT (
x 1024 + 0.5)
ADCR0 = SAR x 64 or (ADCR0 - 0.5) x AVREF 1024 VAIN < (ADCR0 + 0.5) x AVREF 1024
where, INT( ): VAIN: AVREF: SAR:
Function that returns integer part of value in parentheses Analog input voltage AVREF pin voltage Successive approximation register
ADCR0: A/D conversion result register 0 (ADCR0) value
Figure 13-8 shows the relationship between the analog input voltage and the A/D conversion result. Figure 13-8. Relationship Between Analog Input Voltage and A/D Conversion Result
SAR
ADCR0
1023
FFC0H
1022
FF80H
1021 A/D conversion result (ADCR0) 3
FF40H
00C0H
2
0080H
1
0040H
0 1 1 3 2 5 3 2048 1024204810242048 1024 2043 1022 2045 1023 2047 1 2048 1024 2048 1024 2048
0000H
Input voltage/AVREF
234
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
13.4.3 A/D converter operation mode Select one analog input channel from among ANI0 to ANI7 using analog input channel specification register 0 (ADS0) to start A/D conversion. A/D conversion can be started in either of the following two ways. * Hardware start: Conversion is started by trigger input (rising edge, falling edge, or both rising and falling edges enabled). * Software start: Conversion is started by setting A/D converter mode register 0 (ADM0). When A/D conversion is complete, the interrupt request signal (INTAD0) is generated. (1) A/D conversion by hardware start When bit 6 (TRG0) and bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) are set to 1 after bit 0 (ADCE0) is set to 1, the A/D conversion standby state is set. When the external trigger signal (ADTRG) is input, A/D conversion of the voltage applied to the analog input pin specified by analog input channel specification register 0 (ADS0) starts. Upon the end of A/D conversion, the conversion result is stored in A/D conversion result register 0 (ADCR0), and the interrupt request signal (INTAD0) is generated. After one A/D conversion operation is started and finished, the A/D conversion operation is not started until a new external trigger signal is input. If ADM0 and ADS0 are rewritten during A/D conversion, the converter suspends A/D conversion and waits for a new external trigger signal to be input. When the external trigger input signal is reinput, A/D conversion is restarted from the beginning. If ADS0 is rewritten during A/D conversion standby, A/D conversion restarts from the beginning when the following external trigger input signal is input. If 1 is written to ADCS0 again during A/D conversion, the A/D conversion in progress is discontinued and the A/D conversion is restarted from the beginning when the next external trigger input signal is input. If 0 is written to ADCS0 during A/D conversion, the A/D conversion operation stops immediately. At this time, the conversion result is undefined. Caution When P03/INTP3/ADTRG is used as the external trigger input (ADTRG), specify the valid edge using bits 1 and 2 (EGA00, EGA01) of A/D converter mode register 0 (ADM0) and set the interrupt mask flag (PMK3) to 1.
User's Manual U14260EJ3V1UD
235
CHAPTER 13
A/D CONVERTER
Figure 13-9. A/D Conversion by Hardware Start (When Falling Edge Is Specified)
ADTRG ADM0 set ADCE0 = 1, ADCS0 = 1, TRG0 = 1
Standby state
ADS0 rewrite
A/D conversion
Standby state
ANIn
ANIn
ANIn
Standby state
ANIm
ANIm
ANIm
ADCR0
ANIn
ANIn
ANIn
Undefined
ANIm
ANIm
INTAD0
Remarks 1. n = 0, 1, ......, 7 2. m = 0, 1, ......, 7
236
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(2) A/D conversion by software start When bit 6 (TRG0) and bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) are set to 0 and 1, respectively, after bit 0 (ADCE0) is set to 1, A/D conversion of the voltage applied to the analog input pin specified by analog input channel specification register 0 (ADS0) starts. Upon the end of A/D conversion, the conversion result is stored in A/D conversion result register 0 (ADCR0), and the interrupt request signal (INTAD0) is generated. After one A/D conversion operation is started and finished, the next conversion operation is immediately started. A/D conversion operations are repeated until new data is written to ADS0. If ADM0 and ADS0 are rewritten during A/D conversion, the converter suspends A/D conversion and A/D conversion of the selected analog input channel restarts from the beginning. If 1 is written to ADCS0 again during A/D conversion, the A/D conversion in progress is discontinued and the A/D conversion is restarted from the beginning. If 0 is written to ADCS0 during A/D conversion, the A/D conversion operation stops immediately. At this time, the conversion result is undefined. Figure 13-10. A/D Conversion by Software Start
ADM0 set ADCE0 = 1, ADCS0 = 1, TRG0 = 0
ADS0 rewrite
ADCS0 = 0
A/D conversion
ANIn
ANIn
ANIn
ANIm
ANIm
Conversion suspended; Conversion results are not stored
Stop
ADCR0
ANIn
ANIn
Undefined
ANIm
INTAD0
Remarks 1. n = 0, 1, ......, 7 2. m = 0, 1, ......, 7
User's Manual U14260EJ3V1UD
237
CHAPTER 13
A/D CONVERTER
13.5 How to Read A/D Converter Characteristics Table
Here, special terms unique to the A/D converters are explained. (1) Resolution This is the minimum analog input voltage that can be identified. That is, the percentage of the analog input voltage per 1 bit of digital output is called 1 LSB (Least Significant Bit). The percentage of 1 LSB with respect to the full scale is expressed by %FSR (Full Scale Range). When the resolution is 10 bits, 1 LSB = 1/210 = 1/1024 = 0.098%FSR Accuracy has no relation to resolution, but is determined by overall error. (2) Overall error This shows the maximum error value between the actual measured value and the theoretical value. Zero-scale error, full-scale error, integral linearity error, differential linearity error and errors that are combinations of these express the overall error. Note that the quantization error is not included in the overall error in the characteristics table. (3) Quantization error When analog values are converted to digital values, a 1/2 LSB error naturally occurs. In an A/D converter, an analog input voltage in a range of 1/2 LSB is converted to the same digital code, so a quantization error cannot be avoided. Note that the quantization error is not included in the overall error, zero-scale error, full-scale error, integral linearity error, and differential linearity error in the characteristics table. Figure 13-11. Overall Error Figure 13-12. Quantization Error
1......1
1......1
Ideal line
Digital output Digital output
Overall error
1/2 LSB
Quantization error 1/2 LSB
0......0 0 Analog input AVREF
0......0 0 Analog input AVREF
238
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(4) Zero-scale error This shows the difference between the actual measured value of the analog input voltage and the theoretical value (1/2 LSB) when the digital output changes from 0......000 to 0......001. If the actual measured value is greater than the theoretical value, it shows the difference between the actual measured value of the analog input voltage and the theoretical value (3/2 LSB) when the digital output changes from 0......001 to 0......010. (5) Full-scale error This shows the difference between the actual measured value of the analog input voltage and the theoretical value (full scale - 3/2 LSB) when the digital output changes from 1......110 to 1......111. (6) Integral linearity error This shows the degree to which the conversion characteristics deviate from the ideal linear relationship. It expresses the maximum value of the difference between the actual measured value and the ideal straight line when the zero-scale error and full-scale error are 0. (7) Differential linearity error Although the ideal output width for a given code is 1 LSB, this value shows the difference between the actual measured value and the ideal value of the width when outputting a particular code. Figure 13-13. Zero-Scale Error
111
Figure 13-14. Full-Scale Error
Digital output (lower 3 bits)
Digital output (lower 3 bits)
Full-scale error 111 110 101 000 0 AVREF-3 AVREF-2 AVREF-1 AVREF Analog input (LSB)
Ideal line 011
010 001 000 0 1 2 3 AVREF Analog input (LSB)
Ideal line
Zero-scale error
Figure 13-15. Integral Linearity Error
Figure 13-16. Differential Linearity Error
1......1
1......1 Ideal line
Digital output
Digital output
Ideal width of 1 LSB
0......0 0
Integral linearity error AVREF Analog input
Differential linearity error 0......0 0 Analog input AVREF
User's Manual U14260EJ3V1UD
239
CHAPTER 13
A/D CONVERTER
(8) Conversion time This expresses the time from when sampling is started to the time when the digital output is obtained. The sampling time is included in the conversion time in the characteristics table. (9) Sampling time This is the time the analog switch is turned on for the analog voltage to be sampled by the sample & hold circuit.
Sampling time
Conversion time
240
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
13.6 Cautions for A/D Converter
(1) Power consumption in standby mode The A/D converter stops operating in the standby mode. At this time, power consumption can be reduced by setting bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) to 0 (see Figure 13-2). (2) Input range of ANI0 to ANI7 The input voltages of ANI0 to ANI7 should be within the rated range. In particular, if a voltage of AVREF or higher or AVSS or lower is input (even if within the absolute maximum rating range), the conversion value of that channel will be undefined and the conversion values of other channels may also be affected. (3) Conflicting operations <1> Conflict between A/D conversion result register 0 (ADCR0) write and ADCR0 read by instruction upon the end of conversion ADCR0 read is given priority. After the read operation, the new conversion result is written to ADCR0. <2> Conflict between ADCR0 write and external trigger signal input upon the end of conversion The external trigger signal is not acknowledged during A/D conversion. Therefore, the external trigger signal is not acknowledged during ADCR0 write. <3> Conflict between ADCR0 write and A/D converter mode register 0 (ADM0) write or analog input channel specification register 0 (ADS0) write ADM0 or ADS0 write is given priority. ADCR0 write is not performed, nor is the conversion end interrupt request signal (INTAD0) generated. (4) ANI0/P10 to ANI7/P17 <1> The analog input pins (ANI0 to ANI7) also function as input port pins (P10 to P17). When A/D conversion is performed with any of pins ANI0 to ANI7 selected, do not access port 1 while conversion is in progress, as this may reduce the conversion resolution. <2> If digital pulses are applied to the pin adjacent to a pin in the process of A/D conversion, the expected A/D conversion value may not be obtainable due to coupling noise. Therefore, avoid applying pulses to the pin adjacent to a pin undergoing A/D conversion. (5) Input impedance of ANI0 to ANI7 pins This A/D converter executes sampling by charging the internal sampling capacitor for approximately 1/8 of the conversion time. Therefore, only the leakage current flows during other than sampling, and the current for charging the capacitor flows during sampling. The input impedance therefore varies and has no meaning. To achieve sufficient sampling, it is recommended that the output impedance of the analog input source be 10 k or less, or attach a capacitor of around 100 pF to the ANI0 to ANI7 pins (see Figure 13-22). (6) AVREF pin input impedance A series resistor string of several tens of k is connected between the AVREF pin and the AVSS pin. Therefore, when the output impedance of the reference voltage is too high, it seems as if the AVREF pin and the series resistor string are connected in series. This may cause a greater reference voltage error.
User's Manual U14260EJ3V1UD
241
CHAPTER 13
A/D CONVERTER
(7) Interrupt request flag (ADIF0) The interrupt request flag (ADIF0) is not cleared even if analog input channel specification register 0 (ADS0) is changed. Therefore, if an analog input pin is changed during A/D conversion, the A/D conversion result and ADIF0 for the pre-change analog input may be set just before the ADS0 rewrite. Caution is therefore required since, at this time, when ADIF0 is read immediately just after the ADS0 rewrite, ADIF0 is set despite the fact that the A/D conversion for the post-change analog input has not finished. When A/D conversion is restarted after it is stopped, clear ADIF0 before restart. Figure 13-17. A/D Conversion End Interrupt Request Generation Timing
ADM0 rewrite (start of ANIn conversion)
ADS0 rewrite (start of ANIm conversion)
ADIF is set but ANIm conversion has not finished.
A/D conversion
ANIn
ANIn
ANIm
ANIm
ADCR0
ANIn
Undefined
ANIm
ANIm
ADIF0
Remarks 1. n = 0, 1, ......, 7 2. m = 0, 1, ......, 7 (8) Conversion results just after A/D conversion start If bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) is set to 1 without setting bit 0 (ADCE0) to 1, the A/D conversion value immediately after A/D conversion has been started may not satisfy the rated value. Take measures such as polling the A/D conversion end interrupt request (INTAD0) and removing the first conversion results. The same may apply if ADCS0 is set to 1 without a lapse of a wait time of 14 s (MIN.) after ADCE0 has been set to 1. Make sure that the specified wait time elapses. (9) A/D conversion result register 0 (ADCR0) read operation When A/D converter mode register 0 (ADM0) and analog input channel specification register 0 (ADS0) are written, the contents of ADCR0 may become undefined. Read the conversion result following conversion completion before writing to ADM0 and ADS0. Using a timing other than the above may cause an incorrect conversion result to be read.
242
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(10) Timing at which A/D conversion result is undefined The A/D conversion value may be undefined if the timing of completion of A/D conversion and the timing of stopping the A/D conversion conflict. Therefore, read the A/D conversion result before stopping the A/D operation. Figure 13-18 shows the timing of reading the conversion result. Figure 13-18. Timing of Reading Conversion Result (When Conversion Result Is Undefined)
A/D conversion complete
A/D conversion complete
ADCR0 INTAD0 ADCS0
Normal conversion result
Undefined value
Normal conversion result is read.
A/D conversion is stopped.
Undefined value is read.
(11) Notes on board design Locate analog circuits as far away from digital circuits as possible on the board because the analog circuits may be affected by the noise of the digital circuits. In particular, do not cross an analog signal line with a digital signal line, or wire an analog signal line in the vicinity of a digital signal line. characteristics may be affected by the noise of the digital line. Connect AVSS0 and VSS0 at one location on the board where the voltages are stable. Otherwise, the A/D conversion
User's Manual U14260EJ3V1UD
243
CHAPTER 13
A/D CONVERTER
(12) AVREF pin Connect a capacitor to the AVREF pin to minimize conversion errors due to noise. If an A/D conversion operation has been stopped and is then started, the voltage applied to the AVREF pin becomes unstable, causing the accuracy of the A/D conversion to drop. To prevent this, also connect a capacitor to the AVREF pin. Figure 13-19 shows an example of connecting a capacitor. Figure 13-19. Example of Connecting Capacitor to AVREF Pin
Clamp using a diode with a low VF (0.3 V or lower).
VDD0
AVREF C1 C2 AVSS
Remark C1: 4.7 F to 10 F (reference value) C2: 0.01 F to 0.1 F (reference value) Connect C2 as close to the pin as possible.
244
User's Manual U14260EJ3V1UD
CHAPTER 13
A/D CONVERTER
(13) A/D converter sampling time and A/D conversion start delay time The sampling time of the A/D converter varies depending on the values set in A/D converter mode register 0 (ADM0). There is a delay time from when the A/D converter is enabled for operation until sampling is actually performed. For the sets in which a strict A/D conversion time is required, note the contents described in Figure 13-20 and Table 13-3. Figure 13-20. Timing of A/D Converter Sampling and A/D Conversion Start Delay
ADCS0 1, external trigger, or ADS0 rewrite
ADCS0
Sampling timing
INTAD0
A/D Sampling conversion time start delay time
Sampling time Conversion time Conversion time
Table 13-3. Sampling Time and A/D Conversion Start Delay Time of A/D Converter
FR02 FR01 FR00 Conversion TimeNote 1 Sampling Time A/D Conversion Start Delay Time MIN. 0 0 0 1 1 1 0 0 1 0 0 1 0 1 0 0 1 0 144/fX 120/fX 96/fX 72/fX 60/fX 48/fX Setting prohibited 20/fX 16/fX 12/fX 10/fX 8/fX 6/fX - - - 0.5/fCPU + 3/fX 0.5/fCPU + 4/fX 0.5/fCPU + 6/fX MAX. 0.5/fCPU + 8/fX
Other than above
Notes 1. Set the A/D conversion time as follows. * When operated at fX = 12 MHzNote 2 (VDD = 4.5 to 5.5 V): 12 s or more * When operated at fX = 8.38 MHz (VDD = 4.0 to 5.5 V): 14 s or more 2. Expanded-specification products of PD780078 Subseries only. Remark fX: Main system clock oscillation frequency
fCPU: CPU clock frequency
User's Manual U14260EJ3V1UD
245
CHAPTER 13
A/D CONVERTER
(14) Internal equivalent circuit of ANI0 to ANI7 pins and permissible signal source impedance To complete sampling within the sampling time with sufficient A/D conversion accuracy, the impedance of the signal source such as a sensor must be sufficiently low. Figure 13-21 shows the internal equivalent circuit of the ANI0 to ANI7 pins. If the impedance of the signal source is high, connect capacitors with a high capacitance to the ANI0 to ANI7 pins. An example of this is shown in Figure 13-22. In this case, however, the microcontroller cannot follow an analog signal with a high differential coefficient because a lowpass filter is created. To convert a high-speed analog signal or to convert an analog signal in the scan mode, insert a low-impedance buffer. Figure 13-21. Internal Equivalent Circuit of Pins ANI0 to ANI7
R1 ANIn
R2
C1
C2
C3
Table 13-4. Resistances and Capacitances of Equivalent Circuit (Reference Values)
AVREF 2.7 V 4.5 V R1 12 k 4 k R2 8 k 2.7 k C1 8 pF 8 pF C2 3 pF 1.4 pF C3 2 pF 2 pF
Caution
The resistances and capacitances in Table 13-4 are not guaranteed values.
Figure 13-22. Example of Connection When Signal Source Impedance Is High
If a noise of AVREF or higher or AVSS or lower may be generated, clamp using a diode with a low VF (0.3 V or lower). Reference voltage input AVREF
Output impedance of sensor R0
ANIn
R1
R2
C1 C0 0.1 F Lowpass filter is created. C0
C2
C3
Remark n = 0 to 7
246
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
14.1
Functions of Serial Interface UART0
Serial interface UART0 has the following three modes. (1) Operation stop mode This mode is used when serial transfers are not performed to reduce power consumption. For details, see 14.4.1 Operation stop mode. (2) Asynchronous serial interface (UART) mode (fixed to LSB first) This mode enables full-duplex operation wherein one byte of data after the start bit is transmitted and received. The on-chip baud rate generator dedicated to UART enables communications using a wide range of selectable baud rates. The communication range is between 1.2 kbps and 131 kbps (when operated at fX = 8.38 MHz). In addition, a baud rate (39 kbps max. (when operated at fX = 1.25 MHz)) can also be defined by dividing the clock input to the ASCK0 pin. The UART baud rate generator can also be used to generate a MIDI-standard baud rate (31.25 kbps). For details, see 14.4.2 Asynchronous serial interface (UART) mode. (3) Infrared data transfer mode For details, see 14.4.3 Infrared data transfer mode. Figure 14-1 shows a block diagram of serial interface UART0.
User's Manual U14260EJ3V1UD
247
CHAPTER 14
SERIAL INTERFACE UART0
Figure 14-1. Block Diagram of Serial Interface UART0
Internal bus Asynchronous serial interface mode register 0 (ASIM0) Receive buffer register 0 (RXB0) Asynchronous serial interface status register 0 (ASIS0) PE0 FE0 OVE0 TXE0 RXE0 PS01 PS00 CL0 SL0 ISRM0 IRDAM0
RxD0/P23
Receive shift register 0 (RX0)
Transmit shift register 0 (TXS0)
TxD0/P24
Receive controller (parity check)
INTSER0 INTSR0
Transmit controller (parity addition)
PM24
Output latch (P24)
INTST0
Baud rate generatorNote
ASK0/P25 fX/2 to fX/27
Note For the configuration of the baud rate generator, refer to Figure 14-2. Figure 14-2. Block Diagram of Baud Rate Generator
Start bit sampling clock
Selector
TXE0
ASCK0/P25 fX/2 to fX/27
5-bit counter Transmit clock 1/2 Match
Encoder Receive clock 1/2 Match
5-bit counter 3 4
RXE0 Start bit detection
TPS02 TPS01 TPS00 MDL03 MDL02 MDL01 MDL00 Baud rate generator control register 0 (BRGC0) Internal bus
Remark TXE0: Bit 7 of asynchronous serial interface mode register 0 (ASIM0) RXE0: Bit 6 of asynchronous serial interface mode register 0 (ASIM0)
248
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
14.2
Configuration of Serial Interface UART0
Serial interface UART0 includes the following hardware. Table 14-1. Configuration of Serial Interface UART0
Item Registers Configuration Transmit shift register 0 (TXS0) Receive shift register 0 (RX0) Receive buffer register 0 (RXB0) Asynchronous serial interface mode register 0 (ASIM0) Asynchronous serial interface status register 0 (ASIS0) Baud rate generator control register 0 (BRGC0) Port mode register 2 (PM2) Port register 2 (P2)
Control registers
(1) Transmit shift register 0 (TXS0) This is a register for setting transmit data. Data written to TXS0 is transmitted as serial data. When the data length is set as 7 bits, bits 0 to 6 of the data written to TXS0 are transferred as transmit data. Writing data to TXS0 starts the transmit operation. TXS0 can be written by an 8-bit memory manipulation instruction. It cannot be read. RESET input sets TXS0 to FFH. Caution Do not write to TXS0 during a transmit operation. The same address is assigned to TXS0 and receive buffer register 0 (RXB0), so a read operation reads values from RXB0. (2) Receive shift register 0 (RX0) This register converts serial data input via the RxD0 pin to parallel data. When one byte of data is received at this register, the receive data is transferred to receive buffer register 0 (RXB0). RX0 cannot be manipulated directly by a program. (3) Receive buffer register 0 (RXB0) This register is used to hold receive data. When one byte of data is received, one byte of new receive data is transferred from the receive shift register (RX0). When the data length is set as 7 bits, receive data is sent to bits 0 to 6 of RXB0. In this case, the MSB of RXB0 is always 0. RXB0 can be read by an 8-bit memory manipulation instruction. It cannot be written. RESET input sets RXB0 to FFH. Caution The same address is assigned to RXB0 and transmit shift register 0 (TXS0), so during a write operation, values are written to TXS0.
User's Manual U14260EJ3V1UD
249
CHAPTER 14
SERIAL INTERFACE UART0
(4) Transmission controller The transmission controller controls transmit operations, such as adding a start bit, parity bit, and stop bit to data that is written to transmit shift register 0 (TXS0), based on the values set to asynchronous serial interface mode register 0 (ASIM0). (5) Reception controller The reception controller controls receive operations based on the values set to asynchronous serial interface mode register 0 (ASIM0). During a receive operation, it performs error checking, such as for parity errors, and sets various values to asynchronous serial interface status register 0 (ASIS0) according to the type of error that is detected.
14.3
Registers to Control Serial Interface UART0
Serial interface UART0 uses the following five registers for control functions. * Asynchronous serial interface mode register 0 (ASIM0) * Asynchronous serial interface status register 0 (ASIS0) * Baud rate generator control register 0 (BRGC0) * Port mode register 2 (PM2) * Port register 2 (P2) (1) Asynchronous serial interface mode register 0 (ASIM0) This is an 8-bit register that controls serial interface UART0's serial transfer operations. ASIM0 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears ASIM0 to 00H. Figure 14-3 shows the format of ASIM0.
250
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
Figure 14-3. Format of Asynchronous Serial Interface Mode Register 0 (ASIM0)
Address: FFA0H After reset: 00H Symbol ASIM0 7 TXE0 6 RXE0 R/W 5 PS01 4 PS00 3 CL0 2 SL0 1 ISRM0 0 IRDAM0
TXE0 0 0
RXE0 0 1
Operation mode Operation stop UART mode (receive only) UART mode (transmit only) UART mode (transmit and receive)
RxD0/P23 pin function Port function (P23) Serial function (RxD0)
TxD0/P24 pin function Port function (P24)
1
0
Port function (P23)
Serial function (TxD0)
1
1
Serial function (RxD0)
PS01 0 0
PS00 0 1 No parity
Parity bit specification
Zero parity always added during transmission No parity detection during reception (parity errors do not occur) Odd parity Even parity
1 1
0 1
CL0 0 1 7 bits 8 bits
Character length specification
SL0 0 1 1 bit 2 bits
Stop bit length specification for transmit data
ISRM0 0 1
Receive completion interrupt control when error occurs Receive completion interrupt request is issued when an error occurs Receive completion interrupt request is not issued when an error occurs
IRDAM0 0 1 UART (transmit/receive) mode
Mode specificationNote 1
Infrared data transfer (transmit/receive) modeNote 2
Notes 1. The UART/infrared data transfer mode operation is controlled by TXE0 and RXE0. 2. When using infrared data transfer mode, be sure to set baud rate generator control register 0 (BRGC0) to 10H. Caution Before writing different data to ASIM0, stop operation.
User's Manual U14260EJ3V1UD
251
CHAPTER 14
SERIAL INTERFACE UART0
(2) Asynchronous serial interface status register 0 (ASIS0) When a receive error occurs in UART mode, this register indicates the type of error. ASIS0 can be read by an 8-bit memory manipulation instruction. RESET input clears ASIS0 to 00H. Figure 14-4. Format of Asynchronous Serial Interface Status Register 0 (ASIS0)
Address: FFA1H After reset: 00H Symbol ASIS0 7 0 6 0 R 5 0 4 0 3 0 2 PE0 1 FE0 0 OVE0
PE0 0 1 No parity error
Parity error flag
Parity error (Parity of transmit data does not match)
FE0 0 1 No framing error Framing errorNote 1 (Stop bit not detected)
Framing error flag
OVE0 0 1 No overrun error
Overrun error flag
Overrun errorNote 2 (Next receive operation was completed before data was read from receive buffer register 0 (RXB0))
Notes 1. Even if the stop bit length is set to two bits by setting bit 2 (SL0) of asynchronous serial interface mode register 0 (ASIM0), stop bit detection during a receive operation only applies to a stop bit length of 1 bit. 2. When an overrun error has occurred, further overrun errors will continue to occur until the contents of receive buffer register 0 (RXB0) are read. (3) Baud rate generator control register 0 (BRGC0) This register sets the serial clock for the serial interface. BRGC0 is set by an 8-bit memory manipulation instruction. RESET input clears BRGC0 to 00H. Figure 14-5 shows the format of BRGC0.
252
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
Figure 14-5. Format of Baud Rate Generator Control Register 0 (BRGC0)
Address: FFA2H After reset: 00H Symbol BRGC0 7 0 6 TPS02 R/W 5 TPS01 4 TPS00 3 MDL03 2 MDL02 1 MDL01 0 MDL00
TPS02 0 0 0 0 1 1 1 1
TPS01 0 0 1 1 0 0 1 1
TPS00 0 1 0 1 0 1 0 1
Source clock selection for 5-bit counter External clock input to ASCK0 fX/2 fX/22 fX/23 fX/24 fX/25 fX/26 fX/27
n 0 1 2 3 4 5 6 7
MDL03 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1
MDL02 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
MDL01 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1
MDL00 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1
Output clock selection for baud rate generator fSCK0/16 fSCK0/17 fSCK0/18 fSCK0/19 fSCK0/20 fSCK0/21 fSCK0/22 fSCK0/23 fSCK0/24 fSCK0/25 fSCK0/26 fSCK0/27 fSCK0/28 fSCK0/29 fSCK0/30 Setting prohibited
k 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 --
Cautions 1. Writing to BRGC0 during a communication operation may cause abnormal output from the baud rate generator and disable further communication operations. Therefore, do not write to BRGC0 during a communication operation. 2. Set BRGC0 to 10H when using in infrared data transfer mode. Remarks 1. 2. 3. 4. 5. fX: Main system clock oscillation frequency fSCK0: Source clock for 5-bit counter n: Value set via TPS00 to TPS02 (0 n 7) k: Value set via MDL00 to MDL03 (0 k 14) The equation for the baud rate is as follows. [Baud rate] = fX 2n+1(k + 16) [Hz]
User's Manual U14260EJ3V1UD
253
CHAPTER 14
SERIAL INTERFACE UART0
(4) Port mode register 2 (PM2) Port mode register 2 is used to set input/output of port 2 in 1-bit units. To use the P24/TxD0 pin as a serial data output, set PM24 and the output latch of P24 to 0. To use the P23/RxD0 pin as a serial data input, and the P25/ASCK0 pin as a clock input, set PM23 and PM25 to 1. At this time, the output latches of P23 and P25 can be either 0 or 1. PM2 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM2 to FFH. Figure 14-6. Format of Port Mode Register 2 (PM2)
Address: FF22H After reset: FFH Symbol PM2 7 1 6 1 R/W 5 PM25 4 PM24 3 PM23 2 PM22 1 PM21 0 PM20
PM2n 0 1
I/O mode selection of P2n pin (n = 0 to 5) Output mode (output buffer on) Input mode (output buffer off)
254
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
14.4
Operation of Serial Interface UART0
This section explains the three modes of serial interface UART0. 14.4.1 Operation stop mode Because serial transfer is not performed in this mode, the power consumption can be reduced. In addition, pins can be used as ordinary ports. To set the operation stop mode, clear bits 7 and 6 (TXE0 and RXE0) of ASIM0 to 0. (1) Register to be used Operation stop mode is set by asynchronous serial interface mode register 0 (ASIM0). ASIM0 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears ASIM0 to 00H.
Address: FFA0H After reset: 00H Symbol ASIM0 7 TXE0 6 RXE0 R/W 5 PS01 4 PS00 3 CL0 2 SL0 1 ISRM0 0 IRDAM0
TXE0 0
RXE0 0
Operation mode Operation stop
RxD0/P23 pin function Port function (P23)
TxD0/P24 pin function Port function (P24)
14.4.2 Asynchronous serial interface (UART) mode This mode enables full-duplex operation wherein one byte of data after the start bit is transmitted or received. The on-chip baud rate generator dedicated to UART enables communications using a wide range of selectable baud rates. The communication range is between 1.2 kbps and 131 kbps (when operated at fX = 8.38 MHz). The baud rate (39 kbps max. (when operated at fX = 1.25 MHz)) can be defined by dividing the input clock to the ASCK0 pin. The UART baud rate generator can also be used to generate a MIDI-standard baud rate (31.25 kbps). (1) Registers to be used * Asynchronous serial interface mode register 0 (ASIM0) * Asynchronous serial interface status register 0 (ASIS0) * Baud rate generator control register 0 (BRGC0) * Port mode register 2 (PM2) * Port register 2 (P2) The basic procedure of setting an operation in the UART mode is as follows. <1> Set the BRGC0 register (see Figure 14-5). <2> Set bits 5 to 1 (PS01, PS00, CL0, SL0, and ISRM0) of the ASIM0 register and clear bit 0 (IRDAM0) to 0 (see Figure 14-3). <3> Set bit 7 (TXE0) of the ASIM0 register to 1. Transmission is enabled. <4> Set bit 6 (RXE0) of the ASIM0 register to 1. Reception is enabled. <5> Write data to the TXS0 register. Data transmission is started. Caution Take relationship with the other party of communication when setting the port mode register and port register.
User's Manual U14260EJ3V1UD
255
CHAPTER 14
SERIAL INTERFACE UART0
The relationship between the register settings and pins is shown below. Table 14-2. Relationship Between Register Settings and Pins (UART Mode)
ASIM0 TXE0 RXE0 PS01 PS00 CL0 SL0 x 0/1 0/1 ISRM0 IRDAM0 x xNote x xNote xNote 0 0 0 0 PM23 P23 PM24 P24 Operation Mode Pin Function P23/ RxD0 1 xNote 1 Reception Transmission RxD0 P23 P24/ TxD0 P24 TxD0 TxD0
0 1 1
1 0 1
0/1 0/1 0/1
0/1 0/1 0/1
0/1 0/1 0/1
0/1 x 0/1
0 0 0
Transmission/reception RxD0
Note Can be set as port function. Remark x: don't care, ASIM0: Asynchronous serial interface mode register 0, PMxx: Port mode register, Pxx: Port output latch The transmit/receive clock that is used to generate the baud rate is obtained by dividing the main system clock. * Transmit/receive clock generation for baud rate by using main system clock The main system clock is divided to generate the transmit/receive clock. The baud rate generated from the main system clock is determined according to the following formula. fX 2
n+1
[Baud rate] =
(k + 16)
[Hz]
fX: Main system clock oscillation frequency When ASCK0 is selected as the source clock of the 5-bit counter, substitute the input clock frequency to the ASCK0 pin for fX in the above expression. n: k: Value set via TPS00 to TPS02 (0 n 7, see Figure 14-5) Value set via MDL00 to MDL03 (0 k 14, see Figure 14-5)
256
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
Table 14-3. Relationship Between Main System Clock and Baud Rate Error
Baud Rate (bps) 600 1200 2400 4800 9600 19200 31250 38400 76800 115200 fX = 8.3886 MHz BRGC0 - 7BH 6BH 5BH 4BH 3BH 31H 2BH 1BH 12H ERR (%) - 1.10 1.10 1.10 1.10 1.10 -1.3 1.10 1.10 1.10 fX = 8.000 MHz BRGC0 - 7AH 6AH 5AH 4AH 3AH 30H 2AH 1AH 11H ERR (%) - 0.16 0.16 0.16 0.16 0.16 0 0.16 0.16 2.12 fX = 7.3728 MHz BRGC0 - 78H 68H 58H 48H 38H 2DH 28H 18H 10H ERR (%) - 0 0 0 0 0 1.70 0 0 0 fX = 5.000 MHz BRGC0 - 70H 60H 50H 40H 30H 24H 20H 10H - ERR (%) - 1.73 1.73 1.73 1.73 1.73 0 1.73 1.73 - fX = 4.1943 MHz BRGC0 7BH 6BH 5BH 4BH 3BH 2BH 21H 1BH - - ERR (%) 1.14 1.14 1.14 1.14 1.14 1.14 -1.3 1.14 - -
Remark fX: Main system clock oscillation frequency * Error tolerance range for baud rate The error for the baud rate depends on the number of bits per frame and the 5-bit counter's division ratio [1/(16 + k)]. Figure 14-7 shows an example of the baud rate error tolerance range. Figure 14-7. Error Tolerance (When k = 0), Including Sampling Errors
Ideal sampling point
32T 64T 256T 288T 320T 352T
304T Basic timing START D0 D7 P
15.5T
336T
STOP
High-speed limit timing
START 30.45T
D0 60.9T D0 33.55T 67.1T
D7
P
STOP
304.5T
15.5T
Sampling error 0.5T
STOP
Low-speed limit timing
START
D7 301.95T
P
335.5T
Baud rate error tolerance (when k = 0) =
15.5 320
x 100 = 4.8438 (%)
Caution
The above error tolerance value is the value calculated based on the ideal sample point. In the actual design, allow margins that include errors of timing for detecting a start bit.
Remark T: 5-bit counter's source clock cycle
User's Manual U14260EJ3V1UD
257
CHAPTER 14
SERIAL INTERFACE UART0
(2) Communication operations (a) Data format and waveform example Figures 14-8 and 14-9 show the format and waveform example of the transmit/receive data. Figure 14-8. Example of Transmit/Receive Data Format in Asynchronous Serial Interface
1 data frame Start bit Parity bit Stop bit
D0
D1
D2
D3
D4
D5
D6
D7
Character bits
1 data frame consists of the following bits. * Start bit ............. 1 bit * Character bits ... 7 bits or 8 bits (LSB first) * Parity bit ........... Even parity, odd parity, zero parity, or no parity * Stop bit(s) ......... 1 bit or 2 bits Asynchronous serial interface mode register 0 (ASIM0) is used to set the character bit length, parity selection, and stop bit length within each data frame. When "7 bits" is selected as the number of character bits, only the lower 7 bits (bits 0 to 6) are valid, so that during a transmission the highest bit (bit 7) is ignored and during reception the highest bit (bit 7) must be set to 0.
258
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
Figure 14-9. Example of UART Transmit/Receive Data Waveform 1. Character bit: 8 bits, Parity bit: Even parity, Stop bit: 1 bit, Communication data: 55H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
2. Character bit: 7 bits, Parity bit: Odd parity, Stop bit: 2 bits, Communication data: 36H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
Parity
Stop
Stop
3. Character bit: 8 bits, Parity bit: None, Stop bit: 1 bit, Communication data: 87H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Stop
Baud rate generator control register 0 (BRGC0) is used to set the serial transfer rate. If a receive error occurs, information about the receive error can be ascertained by reading asynchronous serial interface status register 0 (ASIS0).
User's Manual U14260EJ3V1UD
259
CHAPTER 14
SERIAL INTERFACE UART0
(b) Parity types and operations The parity bit is used to detect bit errors in communication data. Usually, the same type of parity bit is used by the transmitting and receiving sides. When odd parity or even parity is set, errors in the parity bit (the odd-number bit) can be detected. When zero parity or no parity is set, errors are not detected. (i) Even parity * During transmission The number of bits in transmit data that includes a parity bit is controlled so that there are an even number of character bits whose value is 1. The value of the parity bit is as follows. If the transmit data contains an odd number of character bits whose value is 1: the parity bit is "1" If the transmit data contains an even number of character bits whose value is 1: the parity bit is "0" * During reception The number of character bits whose value is 1 is counted in the receive data that includes a parity bit, and a parity error occurs when the counted result is an odd number. (ii) Odd parity * During transmission The number of bits in transmit data that includes a parity bit is controlled so that there is an odd number of character bits whose value is 1. The value of the parity bit is as follows. If the transmit data contains an odd number of character bits whose value is 1: the parity bit is "0" If the transmit data contains an even number of character bits whose value is 1: the parity bit is "1" * During reception The number of character bits whose value is 1 is counted in the receive data that includes a parity bit, and a parity error occurs when the counted result is an even number. (iii) Zero parity During transmission, the parity bit is set to "0" regardless of the transmit data. During reception, the parity bit is not checked. Therefore, no parity errors will occur regardless of whether the parity bit is a "0" or a "1". (iv) No parity No parity bit is added to the transmit data. During reception, receive data is regarded as having no parity bit. Since there is no parity bit, no parity errors will occur.
260
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
(c) Transmission The transmit operation is enabled if bit 7 (TXE0) of asynchronous serial interface mode register 0 (ASIM0) is set to 1, and the transmit operation is started when transmit data is written to transmit shift register 0 (TXS0). A start bit, parity bit, and stop bit(s) are automatically added to the data. Starting the transmit operation shifts out the data in TXS0, thereby emptying TXS0, after which a transmit completion interrupt request (INTST0) is issued. Transmission is stopped until the data to be transmitted next is written to TXS0. The timing of the transmit completion interrupt request is shown in Figure 14-10. INTST0 occurs as soon as the last stop bit has been output. Figure 14-10. Timing of Asynchronous Serial Interface Transmit Completion Interrupt Request (i) Stop bit length: 1 bit
TxD0 (output)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTST0
(ii) Stop bit length: 2 bits
TxD0 (output)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTST0
Caution
Do not rewrite asynchronous serial interface mode register 0 (ASIM0) during a transmit operation. Rewriting the ASIM0 register during a transmit operation may disable further transmit operations (in such cases, enter a RESET to restore normal operation).
User's Manual U14260EJ3V1UD
261
CHAPTER 14
SERIAL INTERFACE UART0
(d) Reception The receive operation performs level detection. The receive operation is enabled when 1 is set to bit 6 (RXE0) of asynchronous serial interface mode register 0 (ASIM0), and the input via the RxD0 pin is sampled. The serial clock specified by baud rate generator control register 0 (BRGC0) is used to sample the RxD0 pin. When the RxD0 pin goes low, the 5-bit counter of the baud rate generator begins counting and the start timing signal for data sampling is output when half of the specified baud rate time has elapsed. If sampling the RxD0 pin input at this start timing signal yields a low-level result, a start bit is recognized, after which the 5-bit counter is initialized and starts counting and data sampling begins. After the start bit is recognized, the character data, parity bit, and one-bit stop bit are detected, at which point reception of one data frame is completed. Once reception of one data frame is completed, the receive data in the shift register is transferred to receive buffer register 0 (RXB0) and INTSR0 (receive completion interrupt request) occurs. If the RXE0 bit is reset (to 0) during a receive operation, the receive operation is stopped immediately. At this time, the contents of RXB0 and ASIS0 do not change, nor does INTSR0 or INTSER0 (receive error interrupt request) occur. Figure 14-11 shows the timing of the asynchronous serial interface receive completion interrupt request. Figure 14-11. Timing of Asynchronous Serial Interface Receive Completion Interrupt Request
RxD0 (input)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTSR0
Caution
If the receive operation is enabled with the RxD0 pin input at the low level, the receive operation is immediately started. Make sure the RxD0 pin input is at the high level before enabling the receive operation.
262
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
(e) Receive errors Three types of errors can occur during a receive operation: a parity error, framing error, or overrun error. If, as the result of data reception, an error flag is set in asynchronous serial interface status register 0 (ASIS0), a receive error interrupt request (INTSER0) will occur. Receive error interrupts are generated before the receive completion interrupt request (INTSR0). Table 14-4 lists the causes behind receive errors. As part of receive error interrupt request (INTSER0) servicing, the contents of ASIS0 can be read to determine which type of error occurred during the receive operation (see Table 14-4 and Figure 14-12). The contents of ASIS0 are reset (to 0) when receive buffer register 0 (RXB0) is read or when the next data is received (if the next data contains an error, its error flag will be set). Table 14-4. Causes of Receive Errors
Receive Error Parity error Framing error Overrun error Cause Parity specified does not match parity of receive data Stop bit was not detected Reception of the next data was completed before data was read from receive buffer register 0 (RXB0)
Figure 14-12. Receive Error Timing
RxD0 (input)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTSR0Note
INTSER0 (When framing/overrun error occurs)
INTSER0 (When parity error occurs)
Note Even if a receive error occurs when the ISRM0 bit has been set (1), INTSR0 does not occur. Cautions 1. The contents of asynchronous serial interface status register 0 (ASIS0) are reset (to 0) when receive buffer register 0 (RXB0) is read or when the next data is received. To obtain information about the error, be sure to read the contents of ASIS0 before reading RXB0. 2. Be sure to read the contents of receive buffer register 0 (RXB0) after the receive completion interrupt request has occurred even when a receive error has occurred. If RXB0 is not read after the receive completion interrupt request has occurred, overrun errors will occur during the next data receive operations and the receive error status will remain until the contents of RXB0 are read.
User's Manual U14260EJ3V1UD
263
CHAPTER 14
SERIAL INTERFACE UART0
14.4.3 Infrared data transfer mode In infrared data transfer mode, pulses can be output and received in the data format shown in (2). (1) Registers to be used * Asynchronous serial interface mode register 0 (ASIM0) * Asynchronous serial interface status register 0 (ASIS0) * Baud rate generator control register 0 (BRGC0) * Port mode register 2 (PM2) * Port register 2 (P2) The relationship between the register settings and pins is shown below. Table 14-5. Relationship Between Register Settings and Pins (Infrared Data Transfer Mode)
ASIM0 TXE0 RXE0 PS01 PS00 CL0 SL0 x 0/1 0/1 ISRM0 IRDAM0 x xNote x xNote xNote 0 0 0 0 PM23 P23 PM24 P24 Operation Mode Pin Function P23/ RxD0 1 xNote 1 Reception Transmission RxD0 P23 P24/ TxD0 P24 TxD0 TxD0
0 1 1
1 0 1
0/1 0/1 0/1
0/1 0/1 0/1
0/1 0/1 0/1
0/1 x 0/1
0 0 0
Transmission/reception RxD0
Note Can be set as port function. Caution When using infrared data transfer mode, set baud rate generator control register 0 (BRGC0) to 10H. Remark x: don't care, ASIM0: Asynchronous serial interface mode register 0, PMxx: Port mode register, Pxx: Port output latch (2) Data format Figure 14-13 compares the data format used in UART mode with that used in infrared data transfer mode. The IR (infrared) frame corresponds to the bit string of the UART frame, which consists of pulses that include a start bit, eight data bits, and a stop bit. The length of the electrical pulses that are used to transmit and receive in an IR frame is 3/16 the length of the cycle time for one bit (i.e., the "bit time"). This pulse (whose width is 3/16 the length of one bit time) rises from the middle of the bit time (see the figure below).
Bit time
Pulse width = 3/16 bit time
264
User's Manual U14260EJ3V1UD
CHAPTER 14
SERIAL INTERFACE UART0
Figure 14-13. Data Format Comparison Between Infrared Data Transfer Mode and UART Mode
UART frame Data bits
0 Start bit
1 D0
0 D1
1 D2
0 D3
0 D4
1 D5
1 D6
0 D7
1 Stop bit
IR frame Start bit 0 1 0 1 0 Data bits 0 1 1 0 Stop bit 1
Bit time
Pulse width = 3/16 bit time
(3) Relationship between main system clock and baud rate Table 14-6 shows the relationship between the main system clock and the baud rate. Table 14-6. Relationship Between Main System Clock and Baud Rate
fX = 8.3886 MHz Baud rate 131031 bps fX = 8.000 MHz 125000 bps fX = 7.3728 MHz 115200 bps fX = 5.000 MHz 78125 bps fX = 4.1943 MHz 65536 bps
(4) Bit rate and pulse width Table 14-7 lists the bit rate, bit rate error tolerance, and pulse width values. Table 14-7. Bit Rate and Pulse Width Values
3/16 Pulse Width (s) 1.63
Bit Rate (kbps) 115.2Note 1
Bit Rate Error Tolerance (% of Bit Rate) +/- 0.87
Pulse Width Minimum Value (s)Note 2 1.41
Maximum Pulse Width (s) 2.71
Notes 1. Operation with fX = 7.3728 MHz 2. When a digital noise eliminator is used in a microcontroller operating at 1.41 MHz or above. Caution When using in infrared data transfer mode, set baud rate generator control register 0 (BRGC0) to 10H. Remark fX: Main system clock oscillation frequency
User's Manual U14260EJ3V1UD
265
CHAPTER 14
SERIAL INTERFACE UART0
(5) Input data and internal signals * Transmit operation timing
UART output data
Start bit
Stop bit
UART (Inverted data)
Infrared data transfer enable signal
TxD0 pin output signal
* Receive operation timing Data reception is delayed for one-half of the specified baud rate.
UART transfer data
Start bit
Stop bit
RxD0 input
Edge detection
Sampling clock
Receive rate
Conversion data
Sampling timing
266
User's Manual U14260EJ3V1UD
Table 14-8. Register Settings
(1) Operation stop mode ASIM0 TXE0 0 RXE0 0 PS01 x PS00 x CL0 x SL0 x BRGC0 ISRM0 IRDAM0 TPS02 TPS01 TPS00 MDL03 MDL02 MDL01 MDL00 x x x x x x x x x xNote xNote xNote xNote PM23 P23 PM24 P24 Pin Function P23/RxD0 P23 P24/TxD0 P24 Setting prohibited Operation Mode Stop
Other than above
(2) Asynchronous serial interface (UART) mode ASIM0 TXE0 0 1
User's Manual U14260EJ3V1UD
BRGC0 SL0 x 0/1 0/1 ISRM0 IRDAM0 TPS02 TPS01 TPS00 MDL03 MDL02 MDL01 MDL00 0/1 x 0/1 0 0 0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
PM23
P23
PM24
P24
Pin Function P23/RxD0 P24/TxD0 P24 TxD0 TxD0 Setting prohibited
Operation Mode Receive Transmit Transmit /receive
RXE0 1 0 1
PS01 0/1 0/1 0/1
PS00 0/1 0/1 0/1
CL0 0/1 0/1 0/1
CHAPTER 14
1 xNote 1
x xNote x
x
Note
x
Note
RxD0 P23 RxD0
0 0
0 0
1
Other than above
SERIAL INTERFACE UART0
(3) Infrared data transfer mode ASIM0 TXE0 0 1 1 RXE0 1 0 1 PS01 0/1 0/1 0/1 PS00 0/1 0/1 0/1 CL0 0/1 0/1 0/1 SL0 x 0/1 0/1 BRGC0 ISRM0 IRDAM0 TPS02 TPS01 TPS00 MDL03 MDL02 MDL01 MDL00 0/1 x 0/1 1 1 1 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 xNote 1 x xNote x x
Note
PM23
P23
PM24
P24
Pin Function P23/RxD0 P24/TxD0 P24 TxD0 TxD0 Setting prohibited
Operation Mode Receive Transmit Transmit /receive
x
Note
RxD0 P23 RxD0
0 0
0 0
Other than above
Note Can be set as port function. Caution When using the infrared data transfer mode, set the BRGC0 register to 10H.
Remark x: Don't care, ASIM0: Asynchronous serial interface mode register 0 BRGC0: Baud rate generator control register 0, PMxx: Port mode register, Pxx: Output latch of port
267
CHAPTER 15
SERIAL INTERFACE UART2
Serial interface UART2/SIO3 can be used in asynchronous serial interface (UART) mode or 3-wire serial I/O mode. Caution Do not enable UART2 and SIO3 at the same time.
15.1
Functions of Serial Interface UART2
Serial interface UART2 has the following four modes. (1) Operation stop mode This mode is used when serial transfers are not performed to reduce power consumption. For details, see 15.4.1 Operation stop mode. (2) Asynchronous serial interface (UART) mode (fixed to LSB first) This mode enables full-duplex operation wherein one byte of data after the start bit is transmitted and received. The on-chip baud rate generator dedicated to UART enables communications using a wide range of selectable baud rates. In addition, a baud rate can also be defined by dividing the clock input to the ASCK0 pin. The UART baud rate generator can also be used to generate a MIDI-standard baud rate (31.25 kbps). For details, see 15.4.2 Asynchronous serial interface (UART) mode. (3) Multi-processor transfer mode (fixed to LSB first) In this mode data can be transferred to or received from two or more processors. For details, see 15.4.3 Multi-processor transfer mode. (4) Infrared data transfer (IrDA) mode (fixed to LSB first) In this mode, pulses can be output or received in the data format of IrDA specification. This mode can be used to transfer data with another digital device such as a personal computer. For details, see 15.4.4 Infrared data transfer (IrDA) mode. Figure 15-1 shows a block diagram of serial interface UART2.
268
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-1. Block Diagram of Serial Interface UART2
Internal bus Asynchronous serial interface mode register 2 (ASIM2)
Receive Transmit
RXB2 buffer
register 2
TXB2 buffer
register 2
POWER2 TXE2 RXE2 PS21 PS20 CL2
SL2 ISEM2
RXD2/SO3/P35
RX2 Receive shift
register 2
Asynchronous serial interface status register 2 (ASIS2) Transmit TXS2 shift MPR2 PE2 FE2 OVE2
register 2
TXD2/SI3/P34
PM34 Output latch (PM34) Receive controller (parity check)
Transmit controller (parity addition)
INTST2
INTSER2 INTSR2
Baud rate generatorNote
ASCK2/SCK3/P36 fX/2 to fX/27
Note For the configuration of the baud rate generator, refer to Figure 15-2. Figure 15-2. Block Diagram of Baud Rate Generator
Start bit sampling clock
Selector
TXE2
ASCK2/SCK3/P36 fX/2 to fX/27
8-bit counter Transmit clock 1/2 Match
Encoder Receive clock 1/2 Match
8-bit counter 8
RXE2 Start bit detection
MDL27 MDL26 MDL25 MDL24 MDL23 MDL22 MDL21 MDL20 Baud rate generator control register 2 (BRGC2) Internal bus
Remark TXE2: Bit 7 of asynchronous serial interface mode register 2 (ASIM2) RXE2: Bit 6 of asynchronous serial interface mode register 2 (ASIM2)
User's Manual U14260EJ3V1UD
269
CHAPTER 15
SERIAL INTERFACE UART2
15.2
Configuration of Serial Interface UART2
Serial interface UART2 includes the following hardware. Table 15-1. Configuration of Serial Interface UART2
Item Registers Configuration Transmit shift register 2 (TXS2) Receive shift register 2 (RX2) Transmit buffer register 2 (TXB2) Receive buffer register 2 (RXB2) Asynchronous serial interface mode register 2 (ASIM2) Asynchronous serial interface status register 2 (ASIS2) Asynchronous serial interface transmit status register 2 (ASIF2) Baud rate generator control register 2 (BRGC2) Clock select register 2 (CKSEL2) Transfer mode specification register 2 (TRMC2) Port mode register 3 (PM3) Port register 3 (P3)
Control registers
(1) Transmit shift register 2 (TXS2) This register transmits the data transferred from transmit buffer register 2 (TXB2), as serial data from the TxD2 pin. The value of this register is set to FFH if bits 7 and 6 (TXE2) of asynchronous serial interface mode register 2 (ASIM2) are cleared to 0. TXS2 cannot be manipulated directly by a program. (2) Receive shift register 2 (RX2) This register converts serial data input via the RxD2 pin to parallel data. When one byte of data is received at this register, the receive data is transferred to receive buffer register 2 (RXB2). RX2 cannot be manipulated directly by a program. (3) Transmit buffer register 2 (TXB2) This register sets data to be transmitted. The data written to TXB2 is transferred to transmit shift register 2 (RX2) and transmitted from the TxD2 pin as serial data. No data can be written to TXB2 if bit 1 (TXBF) of transmit status register 2 (ASIF2) is 1. TXB2 is set by an 8-bit memory manipulation instruction. RESET input sets TXB2 to FFH. (4) Receive buffer register 2 (RXB2) This register holds receive data. When one byte of data is received, one byte of new receive data is transferred from the receive shift register (RX2). When the data length is set as 7 bits, receive data is transferred to bits 0 to 6 of RXB2. In this case, the MSB of RXB2 is always 0. If an overrun error (OVE2) occurs, however, the receive data is not transferred to RXB2 but is discarded. RXB2 can be read by an 8-bit memory manipulation instruction. It cannot be written. The value of this register is also initialized to FFH at RESET input or by clearing bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) to 0.
270
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(5) Transmission controller The transmission controller controls transmit operations, such as adding a start bit, parity bit, and stop bit to data that is written to transmit shift register 2 (TXS2), based on the values set to asynchronous serial interface mode register 2 (ASIM2). (6) Reception controller The reception controller controls receive operations based on the values set to asynchronous serial interface mode register 2 (ASIM2). During a receive operation, it performs error checking, such as for parity errors, and sets various values to asynchronous serial interface status register 2 (ASIS2) according to the type of error that is detected.
User's Manual U14260EJ3V1UD
271
CHAPTER 15
SERIAL INTERFACE UART2
15.3
Registers to Control Serial Interface UART2
Serial interface UART2 uses the following eight registers for control functions. * Asynchronous serial interface mode register 2 (ASIM2) * Asynchronous serial interface status register 2 (ASIS2) * Asynchronous serial interface transmit status register 2 (ASIF2) * Baud rate generator control register 2 (BRGC2) * Clock select register 2 (CKSEL2) * Transfer mode specification register 2 (TRMC2) * Port mode register 3 (PM3) * Port register 3 (P3) (1) Asynchronous serial interface mode register 2 (ASIM2) This is an 8-bit register that controls serial interface UART2's serial transfer operations. ASIM2 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears ASIM2 to 00H. Figure 15-3. Format of Asynchronous Serial Interface Mode Register 2 (ASIM2) (1/2)
R/W 5 RXE2 4 PS21 3 PS20 2 CL2 1 SL2 0 ISEM2
Address: FF90H After reset: 00H Symbol ASIM2 7 POWER2 6 TXE2
POWER2 0
Clock operation enable/stop Stop clock operation. Power consumption decreases and latch in UART2 is asynchronously reset (TXD2 pin is low). Enable clock operation (TXD2 pin is high).Note 1
1
TXE2Note 2 0 1
Transmission enable/stop Stop transmission (transmission circuit is synchronously reset). Enable transmission.
RXE2Note 3 0 1
Reception enable/stop Stop reception (reception circuit is synchronously reset). Enable reception.
Notes 1. In the infrared data transfer (IrDA) mode, the TxD2 pin is at the low level. 2. To transmit data with UART2, first specify the clock operation (set POWER2 to 1 and then TXE2 to 1), wait for the duration of 2 clocksNote 4, and then write the transmit data to transmit buffer register 2 (TXB2). To stop transmission by UART2, specify stopping transmission (TXE2 = 0), wait for the duration of 2 clocksNote 4, and then stop the clock operation (POWER2 = 0). 3. To receive data with UART2, first specify the clock operation (set POWER2 to 1 and then RXE2 to 1), wait for the duration of 2 clocksNote 4, and then start reception. To stop reception by UART2, specify stopping reception (RXE2 = 0), wait for the duration of 2 clocksNote 4, and then stop the clock operation (POWER2 = 0). 4. The clock is the output clock of the 8-bit counter or the output clock of the baud rate generator.
272
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-3. Format of Asynchronous Serial Interface Mode Register 2 (ASIM2) (2/2)
PS21Note 1 PS20Note 1 Transmission 0 0 1 1 CL2Note 3 0 1 7 bits 8 bits 0 1 0 1 Do not output parity bit. Output 0 parity. Output odd parity. Output even parity. Parity bit specification Reception Reception without parity Reception as 0 parityNote 2 Identified as odd parity. Identified as even parity.
Data character length specification
SL2Note 4 0 1 1 bit 2 bits
Specification of number of stop bits for transmission
ISEM2Note 5 0 1 INTSR2 is generated INTSER2 is generated
Reception error interrupt signal control
Notes 1. To specify a parity bit, stop transmission and reception (TXE2 = 0 and RXE2 = 0) before rewriting PS21 and PS20. 2. The parity is not identified with this setting. Therefore, bit 2 (PE2) of asynchronous serial interface status register 2 (ASIS2) is not set and the error interrupt does not occur. 3. To specify a data character length, stop transmission and reception (TXE2 = 0 and RXE2 = 0) before rewriting CL2. 4. To specify the number of stop bits, stop transmission (TXE2 = 0) before rewriting SL2. Reception is always performed on the assumption that the number of stop bits is 1. 5. To specify an interrupt that occurs in case of an error, stop reception (RXE2 = 0) before rewriting ISEM2.
User's Manual U14260EJ3V1UD
273
CHAPTER 15
SERIAL INTERFACE UART2
(2) Asynchronous serial interface status register 2 (ASIS2) ASIS2 is a register used to display the error type when a reception error occurs in UART mode. ASIS2 is read by an 8-bit memory manipulation instruction. RESET input clears ASIS2 to 00H. Figure 15-4. Format of Asynchronous Serial Interface Status Register 2 (ASIS2)
Address: FF94H After reset: 00H Symbol ASIS2 7 0 6 0 R 5 0 4 0 3 MPR2Note 1 2 PE2Note 1 1 FE2Note 1 0 OVE2Note 1
MPR2 0 1
ID reception status flag (during reception in multi-processor transfer mode)Note 2 Multi-processor appended bit "1" is not received. Multi-processor appended bit "1" is received.
PE2 0 1 No parity error
Parity error flag
Parity error (Parity of transmit data does not matchNote 3)
FE2 0 1 No framing error Framing errorNote 4 (Stop bit not detected)
Framing error flag
OVE2 0 1 No overrun error
Overrun error flag
Overrun errorNote 5 (Next receive operation was completed before data was read from receive buffer register 2 (RXB2))
Notes 1. These bits are reset to 0 if bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is reset to 0. 2. This flag is affected only if the multi-processor transfer mode is selected by using bits 6 and 7 (TRM02 and TRM12) of transfer mode specification register 2 (TRMC2). 3. The operation of the parity error flag is affected by the set values of bits 3 and 4 (PS20 and PS21) of ASIM2. 4. Even if the stop bit length is set to two bits by setting bit 2 (SL2) of ASIM2, stop bit detection during a receive operation only applies to a stop bit length of 1 bit. 5. Be sure to read the contents of receive buffer register 2 (RXB2) when an overrun error has occurred. Until the contents of RXB2 are read, further overrun errors will occur when receiving data. The next receive data is not written to receive buffer register 2 (RXB2) and is discarded.
274
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(3) Asynchronous serial interface transmit status register 2 (ASIF2) This register indicates the status of transmission. ASIF2 is set by an 8-bit memory manipulation instruction. RESET input clears ASIF2 to 00H. Figure 15-5. Format of Asynchronous Serial Interface Transmit Status Register 2 (ASIF2)
Address: FF95H After reset: 00H Symbol ASIF2 7 0 6 0 R 5 0 4 0 3 0 2 0 1 TXBF 0 TXSF
TXBF 0
Transmit buffer data flag * If bit 7 (POWER2) or bit 6 (TXE2) of asynchronous serial interface mode register 2 (ASIM2) is cleared to 0 * If data is transferred to transmit shift register 2 (TXS2) If data is written to transmit buffer register 2 (TXB2) (if data exists in TXB2) Transmit shift register data flag * If bit 7 (POWER2) or bit 6 (TXE2) of asynchronous serial interface mode register 2 (ASIM2) is cleared to 0 * If no more data is transferred from transmit buffer register 2 (TXB2) after completion of transfer.
1 TXSF 0
1
If data is transferred from transmit buffer register 2 (TXB2) (during transmission)
Cautions 1. To start successive transmission, be sure to check that TXBF is 0 after the first byte of data has been written to transmit buffer register 2 (TXB2), then write the second byte of data to TXB2. 2. When successive transmission is in progress, the processing of writing to TXB2 can be confirmed by checking the value of TXSF after the transmit completion interrupt. * TXSF = 1: Successive transmission in progress. One-byte data can be written. * TXSF = 0: Successive transmission is complete. Two-byte data can be written. When writing, note Caution 1 above. 3. To initialize (to set TXE2 to 0 or POWER2 to 0) during successive transmission, make sure that TXSF is 0 after the transmit completion interrupt, then initialize.
User's Manual U14260EJ3V1UD
275
CHAPTER 15
SERIAL INTERFACE UART2
(4) Baud rate generator control register 2 (BRGC2) This register sets the serial clock for the serial interface. BRGC2 is set by an 8-bit memory manipulation instruction. RESET input clears BRGC2 to 00H. Figure 15-6. Format of Baud Rate Generator Control Register 2 (BRGC2)
Address: FF93H After reset: 00H Symbol BRGC2 7 MDL27 6 MDL26 5 MDL25 R/W 4 MDL24 3 MDL23 2 MDL22 1 MDL21 0 MDL20
MDL27
MDL26
MDL25
MDL24
MDL23
MDL22 x 0 0 0 0 1 1 1 1 0 . . . 1
MDL21 x 0 0 1 1 0 0 1 1 0 . . . 1
MDL20 x 0 1 0 1 0 1 0 1 0 . . . 1
Output clock selection for baud rate generator Setting prohibited fSCK2/8 fSCK2/9 fSCK2/10 fSCK2/11 fSCK2/12 fSCK2/13 fSCK2/14 fSCK2/15 fSCK2/16 . . . fSCK2/255
k
0 0 0 0 0 0 0 0 0 0 . . . 1
0 0 0 0 0 0 0 0 0 0 . . . 1
0 0 0 0 0 0 0 0 0 0 . . . 1
0 0 0 0 0 0 0 0 0 1 . . . 1
0 1 1 1 1 1 1 1 1 0 . . . 1
-- 8 9 10 11 12 13 14 15 16 . . . 255
Caution
Writing to BRGC2 during a communication operation may cause abnormal output from the baud rate generator and disable further communication operations. Therefore, do not write to BRGC2 during a communication operation. Before rewriting BRGC2, clear bits 5 and 6 (RXE2 and TXE2) of asynchronous serial interface mode register 2 (ASIM2) to 0.
Remarks 1. fSCK2: Source clock for 8-bit counter Set by bits 4 to 6 (TPS20 to TPS22) of clock select register 2 (CKSEL2) 2. k: 3. n: Value set via MDL27 to MDL20 (8 k 255) Value set via TPS22 to TPS20 (0 n 7) fX [Hz] 2n+1 x k
4. The equation for the baud rate is as follows. [Baud rate] =
276
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(5) Clock select register 2 (CKSEL2) This 8-bit register is used to select the input clock for the baud rate of UART2 and the transmit pulse width of IrDA. CKSEL2 is set by an 8-bit memory manipulation instruction. RESET input clears CKSEL2 to 00H. Figure 15-7. Format of Clock Select Register 2 (CKSEL2)
Address: FF92H After reset: 00H Symbol CKSEL2 7 0 6 TPS22Note R/W 5 TPS21Note 4 TPS20Note 3 TPW23 2 TPW22 1 TPW21 0 TPW20
TPS22 0 0 0 0 1 1 1 1
TPS21 0 0 1 1 0 0 1 1
TPS20 0 1 0 1 0 1 0 1
Source clock of 8-bit counter External clock input to ASCK2 fX/2 fX/22 fX/23 fX/24 fX/25 fX/26 fX/27
n 0 1 2 3 4 5 6 7
TPW23 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0
TPW22 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0
TPW21 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0
TPW20 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
Selection of IrDA transmit pulse width of 1-bit data Width of two fSCK2 clocks Width of three fSCK2 clocks Width of four fSCK2 clocks Width of five fSCK2 clocks Width of six fSCK2 clocks Width of seven fSCK2 clocks Width of eight fSCK2 clocks Width of nine fSCK2 clocks Width of ten fSCK2 clocks Width of 11 fSCK2 clocks Width of 12 fSCK2 clocks Width of 13 fSCK2 clocks Width of 14 fSCK2 clocks Width of 15 fSCK2 clocks Width of 16 fSCK2 clocks Setting prohibited
Other than above
Note To rewrite TPS20 to TPS22, clear bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) to 0.
User's Manual U14260EJ3V1UD
277
CHAPTER 15
SERIAL INTERFACE UART2
Cautions 1. If data is written to CKSEL2 during a communication operation, the output of the baud rate generator is disturbed and the communication cannot be performed correctly. Therefore, do not rewrite CKSEL2 during communication. 2. To transfer data in the infrared data transfer (IrDA) mode, the following conditions must be satisfied when the transmit pulse width is specified. (Condition) 1.41 s Transmit pulse width Set values of bits 0 to 3 (TPW20 to TPW23) of CKSEL2 < Transfer rate Set values of bits 0 to 7 (MDL20 to MDL27) of BRGC2
Example If the transmit pulse width is set to the width of three fSCK2 clocks (TPW23 to TPW20 = 0, 0, 1, 1)
1-bit cycle Input clock TXD2 pin 3-clock width
Pulse output starts from the center of the 1-bit cycle.
Remark fX:
Main system clock oscillation frequency
fSCK2: Source clock of 8-bit counter
278
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(6) Transfer mode specification register 2 (TRMC2) This 8-bit register is used to specify the transfer mode, switch the interrupt source of INTST2, enable or disable occurrence of the receive completion interrupt in the multi-processor transfer mode, and specify the multiprocessor transfer appended bit. TRMC2 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets TRMC2 to 02H. Figure 15-8. Format of Transfer Mode Specification Register 2 (TRMC2)
Address: FF91H After reset: 02H Symbol TRMC2 7 6 R/W 5 0 4 0 3 ISMD2 2 0 1 MPIEN2 0 MPS2Note 2
TRM12Note 1 TRM02Note 1
TRM12 0 0 1 1
TRM02 0 1 0 1 UART transfer modeNote 3
Transfer mode
Multi-processor transfer modeNote 3 Infrared data transfer (IrDA) modeNote 3
MPIEN2
Receive completion interrupt enable/disable in multi-processor transfer modeNote 4 Condition INTSR2 enable/disable Note 5 Disabled Enabled
0Notes 6, 7 1
If "0" is written to this bit * If bit 7 (POWER2) or bit 6 (TXE2) of asynchronous serial interface mode register 2 (ASIM2) is cleared to 0 * If bit data has been received with multiprocessor appended bit of "1"
ISMD2Note 8 0 1
Switching interrupt source of INTST2 INTST2 occurs when transmission completed INTST2 occurs when data transfer completed
MPS2 0 1
Setting of multi-processor transmission appended bitNote 4 Appends "0" as and transmits multi-processor appended bit (during data transmission). Appends "1" as and transmits multi-processor appended bit (during ID transmission).
Notes 1. Before rewriting TRM12 and TRM02, clear bits 6 (TXE2) and 5 (RXE2) of asynchronous serial interface mode register 2 (ASIM2) to 0. 2. Before setting a value to MPS2, confirm that bit 1 (TXBF) of asynchronous serial interface transmit status register 2 (ASIF2) is cleared to 0. Before writing transmit data to transmit buffer register 2 (TXB2), specify whether "0" or "1" is appended as the multi-processor appended bit. 3. The setting of bits 0 to 4 (ISEM2, SL2, CL2, PS20, and PS21) of ASIM2 is valid in all the transfer modes. 4. The specification by MPIEN2 and MPS2 is valid only when bit 7 (TRM12) is cleared to 0 and bit 6 (TRM02) is set to 1 (i.e., when the multi-processor transfer mode is set).
User's Manual U14260EJ3V1UD
279
CHAPTER 15
SERIAL INTERFACE UART2
Notes 5. Enabling or disabling the occurrence of the receive completion interrupt (INTSR2) in the case of an error is affected by the setting of bit 0 (ISEM2) of ASIM2. 6. Even if MPIEN is cleared to 0, reception is started when the start bit is detected, in order to detect address (ID) reception. At this time, an error in the receive data is not detected if the multi-processor appended bit is "0". If data "1" is received by mistake, due to bit slip or other cause, when the multiprocessor appended bit is detected, however, ID reception is detected. Consequently, the error in the receive data is identified, and the error interrupt signal may be generated and the error flag set. 7. When bit 7 (POWER2) and bit 5 (RXE2) of ASIM2 have not been set to 1, MPIEN2 cannot be cleared to 0 (remain 1) even if 0 is written to it. 8. Before setting ISMD2, clear bit 6 (TXE2) of asynchronous serial interface mode register 2 (ASIM2) to 0. Remark When receiving data in the multi-processor transfer mode, the receive completion interrupt (INTSR2) occurs, regardless of the value of MPIEN2, if data with the multi-processor appended bit set to "1" is received. Usually, this receive data is an address (ID) that indicates the other party of communication. The subsequent receive data can be ignored and the occurrence of an unnecessary receive completion interrupt (INTSR2) can be disabled by comparing this received ID with the ID of the microcontroller (for which software processing is necessary) and clearing MPIEN2 if the two IDs do not match. (7) Port mode register 3 (PM3) PM3 is a register that sets the input/output of port 3 in 1-bit units. To use the P34/TxD2/SI3 pin as a serial data output, set PM34 and the output latch of P34 to 0. To use the P35/RxD2/SO3 pin as a serial data input, and the P36/ASCK2/SCK3 pin as a clock input, set PM35 and PM36 to 1. At this time, the output latches of P35 and P36 can be either 0 or 1. PM3 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM3 to FFH. Figure 15-9. Format of Port Mode Register 3 (PM3)
Address: FF23H After reset: FFH Symbol PM3 7 1 6 PM36 R/W 5 PM35 4 PM34 3 PM33 2 PM32 1 PM31 0 PM30
PM3n 0 1
I/O mode selection of P3n pin (n = 0 to 6) Output mode (output buffer on) Input mode (output buffer off)
280
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
15.4
Operation of Serial Interface UART2
This section explains the four modes of serial interface UART2. 15.4.1 Operation stop mode Because serial transfer is not performed in this mode, the power consumption can be reduced. In addition, pins can be used as ordinary ports. To set the operation stop mode, clear bits 7, 6, and 5 (POWER2, TXE2, and RXE2) of ASIM2 to 0. (1) Register to be used Operation stop mode is set by asynchronous serial interface mode register 2 (ASIM2). ASIM2 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears ASIM2 to 00H.
Address: FF90H After reset: 00H Symbol ASIM2 7 POWER2 6 TXE2 R/W 5 RXE2 4 PS21 3 PS20 2 CL2 1 SL2 0 ISEM2
POWER2 0
Clock operation enable/stop Stop clock operation. Power consumption decreases and latch in UART2 is asynchronously reset (TXD2 pin is low).
TXE2Note 1 0
Transmission enable/stop Stop transmission (transmission circuit is synchronously reset).
RXE2Note 1 0
Reception enable/stop Stop reception (reception circuit is synchronously reset).
Notes 1. To stop serial transmission/reception, wait for the duration of 2 clocksNote 2 after specifying stopping the transmission/reception (TXE2 = 0 or RXE2 = 0), and then stop the clock operation (POWER2 = 0). 2. The clock is the output clock of the 8-bit counter or the output clock of the baud rate generator.
User's Manual U14260EJ3V1UD
281
CHAPTER 15
SERIAL INTERFACE UART2
15.4.2 Asynchronous serial interface (UART) mode This mode enables full-duplex operation wherein one byte of data after the start bit is transmitted or received. The on-chip baud rate generator dedicated to UART enables communications using a wide range of selectable baud rates. The UART baud rate generator can also be used to generate a MIDI-standard baud rate (31.25 kbps). (1) Registers to be used * Asynchronous serial interface mode register 2 (ASIM2) * Asynchronous serial interface status register 2 (ASIS2) * Baud rate generator control register 2 (BRGC2) * Asynchronous serial interface transmit status register 2 (ASIF2) * Clock select register 2 (CKSEL2) * Transfer mode specification register 2 (TRMC2) * Port mode register 3 (PM3) * Port register 3 (P3) The basic procedure of setting an operation in the UART mode is as follows. <1> Set the CKSEL2 register (see Figure 15-7). <2> Set the BRGC2 register (see Figure 15-6). <3> Clear bits 7 and 6 (TRM12 and TRM02) of the TRMC2 register to 0 and set bit 3 (ISMD2) (see Figure 15-8). <4> Set bits 4 to 0 (PS21, PS20, CL2, SL2, and ISEM2) of the ASIM2 register (see Figure 15-3). <5> Set bit 7 (POWER2) of the ASIM2 register to 1. <6> Set bit 6 (TXE2) of the ASIM2 register to 1. Transmission is enabled. <7> Set bit 5 (RXE2) of the ASIM2 register to 1. Reception is enabled. <8> Write data to TXB2. Data transmission is started. Caution Take relationship with the other party of communication when setting the port mode register and port register. The relationship between the register settings and pins is shown below. Table 15-2. Relationship Between Register Settings and Pins (UART Mode)
ASIM2 POW TXE2 RXE2 PS21 PS20 ER2 1 1 1 0 1 1 1 0 1 0/1 0/1 0/1 0/1 0/1 0/1 CL2 TRMC2 SL2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 PM34 P34 PM35 P35 Operation Pin Function Mode P34/ SI3/ TxD2 P35/ SO3/ RxD2 RxD2 P35 RxD2
0/1 0/1 0/1
x 0/1 0/1
0/1 x 0/1
0 0 0
0 0 0
x 0/1 0/1
x x x
x x x
xNote xNote 0 0 0 0
1 xNote 1
x xNote x
Reception P34 Transmission TxD2 Transmission/ TxD2 reception
Note
Can be set as port function.
Caution When using UART2, stop the operation of SIO3 (bit 7 (CSIE3) of serial operation mode register 3 (CSIM3) = 0). Remark x: don't care, ASIM2: Asynchronous serial interface mode register 2, TRMC2: Transfer mode specification register 2, PMxx: Port mode register, Pxx: Port output latch
282
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
The transmit/receive clock that is used to generate the baud rate is obtained by dividing the main system clock. * Transmit/receive clock generation for baud rate by using main system clock The main system clock is divided to generate the transmit/receive clock. The baud rate generated from the main system clock is determined according to the following formula. [Baud rate] = fX 2
n+1
xk
[Hz]
fX: Main system clock oscillation frequency When ASCK2 is selected as the source clock of the 8-bit counter, substitute the input clock frequency to ASCK2 pin for fX in the above expression. n: Value set via TPS20 to TPS22 (0 n 7, see Figure 15-7) k: Value set via MDL27 to MDL20 (8 k 255, see Figure 15-6) * Baud rate error The baud rate error can be calculated by the following expression. Baud rate [bps] Targeted baud rate [bps] Table 15-3 shows an example of the relationship between the main system clock and a baud rate. Table 15-3. Relationship Between Main System Clock and Baud Rate
Baud Rate [bps] n 300 600 1200 2400 4800 9600 19200 31250 38400 76800 7 7 7 6 5 4 3 1 2 1 fX = 7.37 MHz k 96 48 24 24 24 24 24 59 24 24 Error (%) -0.04 -0.04 -0.04 -0.04 -0.04 -0.04 -0.04 -0.07 -0.04 -0.04 n 7 6 5 4 3 2 1 1 - - fX = 5.0 MHz k 65 65 65 65 65 65 65 40 - - Error (%) 0.16 0.16 0.16 0.16 0.16 0.16 0.16 0 - - n 6 5 4 3 2 1 - - - - fX = 4.19 MHz k 109 109 109 109 109 109 - - - - Error (%) 0.11 0.11 0.11 0.11 0.11 0.11 - - - -
[Baud rate error] =
x 100 - 100 [%]
Remark fX: Main system clock oscillation frequency n: Value set by TPS20 to TPS22 (0 n 7) k: Value set by MDL27 to MDL20 (8 k 255)
User's Manual U14260EJ3V1UD
283
CHAPTER 15
SERIAL INTERFACE UART2
* Permissible baud rate range for reception Figure 15-10. Minimum Permissible Data Frame Length and Maximum Permissible Data Frame Length
Data frame length of UART2
Start
D0 FL
D1
D7
P
Stop
1 data frame (11 x FL)
Minimum permissible data frame length
Start
D0
D1
D7
P
Stop
FLmin
Maximum permissible data frame length
Start
D0
D1
D7
P
Stop
FLmax
As shown in the timing chart in Figure 15-10, the latch timing of the receive data is determined by the counter set by using baud rate generator control register 2 (BRGC2) after the start bit has been detected. If the last data (stop bit) is received within this latch timing, the data can be correctly received. This latch timing has a margin of two clocks. Take reception of 11-bit data as an example. 1 bit data length of UART2: FL = (Brate)-1 Minimum permissible data frame length: FLmin = 11 x FL - = 21k + 2 2k k-2 2k x FL
x FL
Therefore, the maximum receivable baud rate of the transmission destination is as follows. 22k 21k + 2
BRmax = (FLmin/11)-1 =
Brate
284
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Similarly, the maximum permissible data frame length is as follows. 10 11 k+2 2k
FLmax = 11 x FL - = FLmax = 21k - 2 2k 21k - 2 20k
x FL
x FL x FL x 11
Therefore, the minimum receivable baud rate of the transmission destination is as follows. 20k 21k - 2
BRmin = (FLmax/11)-1 =
Brate
Remark Brate: Baud rate of UART2 k: FL: Value set by MDL27 to MDL20 (8 k 255) 1 bit data length
From the above expressions for the maximum and minimum baud rates, the permissible error of the baud rate between UART2 and the transmission destination can be calculated as follows. Table 15-4. Maximum Permissible Baud Rate Error and Minimum Permissible Baud Rate Error
k 8 20 50 100 255 Maximum Permissible Baud Rate Error (%) +3.53 +4.26 +4.56 +4.66 +4.72 Minimum Permissible Baud Rate Error (%) -3.61 -4.31 -4.58 -4.67 -4.73
Caution
The above error tolerance value is the value calculated based on the ideal sample point. In the actual design, allow margins that include errors of timing for detecting a start bit.
Remark k: Value set by MDL27 to MDL20 (8 k 255) The accuracy of reception is dependent upon the number of bits in one frame, input clock frequency, and division ratio k (the higher the input clock frequency and the higher the division ratio k, the higher the accuracy).
User's Manual U14260EJ3V1UD
285
CHAPTER 15
SERIAL INTERFACE UART2
(2) Communication operations (a) Data format and waveform example Figures 15-11 and 15-12 show the format and waveform example of the transmit/receive data.
Figure 15-11. Example of Transmit/Receive Data Format in Asynchronous Serial Interface
1 data frame Start bit Parity bit Stop bit
D0
D1
D2
D3
D4
D5
D6
D7
Character bits
1 data frame consists of the following bits. * Start bit ............. 1 bit * Character bits ... 7 bits or 8 bits (LSB first) * Parity bit ........... Even parity, odd parity, zero parity, or no parity * Stop bit(s) ......... 1 bit or 2 bits Asynchronous serial interface mode register 2 (ASIM2) is used to set the character bit length, parity selection, and stop bit length within each data frame. When "7 bits" is selected as the number of character bits, only the lower 7 bits (bits 0 to 6) are valid, so that during a transmission the highest bit (bit 7) is ignored and during reception the highest bit (bit 7) must be set to 0.
286
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-12. Example of UART Transmit/Receive Data Waveform 1. Character bit: 8 bits, Parity bit: Even parity, Stop bit: 1 bit, Communication data: 55H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
2. Character bit: 7 bits, Parity bit: Odd parity, Stop bit: 2 bits, Communication data: 36H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
Parity
Stop
Stop
3. Character bit: 8 bits, Parity bit: None, Stop bit: 1 bit, Communication data: 87H
1 data frame
Start
D0
D1
D2
D3
D4
D5
D6
D7
Stop
Baud rate generator control register 2 (BRGC2) and clock select register 2 (CKSEL2) are used to set the serial transfer rate. If a receive error occurs, information about the receive error can be ascertained by reading asynchronous serial interface status register 2 (ASIS2).
User's Manual U14260EJ3V1UD
287
CHAPTER 15
SERIAL INTERFACE UART2
(b) Parity types and operations The parity bit is used to detect bit errors in communication data. Usually, the same type of parity bit is used by the transmitting and receiving sides. When odd parity or even parity is set, errors in the parity bit (the odd-number bit) can be detected. When zero parity or no parity is set, errors are not detected. (i) Even parity * During transmission The number of character bits in transmit data that includes a parity bit is controlled so that there are an even number of bits whose value is 1. The value of the parity bit is as follows. If the transmit data contains an odd number of character bits whose value is 1: the parity bit is "1" If the transmit data contains an even number of character bits whose value is 1: the parity bit is "0" * During reception The number of character bits whose value is 1 is counted in the receive data that includes a parity bit, and a parity error occurs when the counted result is an odd number. (ii) Odd parity * During transmission The number of character bits in transmit data that includes a parity bit is controlled so that there is an odd number of bits whose value is 1. The value of the parity bit is as follows. If the transmit data contains an odd number of character bits whose value is 1: the parity bit is "0" If the transmit data contains an even number of character bits whose value is 1: the parity bit is "1" * During reception The number of character bits whose value is 1 is counted in the receive data that includes a parity bit, and a parity error occurs when the counted result is an even number. (iii) Zero parity During transmission, the parity bit is set to "0" regardless of the transmit data. During reception, the parity bit is not checked. Therefore, no parity errors will occur regardless of whether the parity bit is a "0" or a "1". (iv) No parity No parity bit is added to the transmit data. During reception, receive data is regarded as having no parity bit. Since there is no parity bit, no parity errors will occur.
288
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(c) Transmission If the UART transfer mode is selected by using transfer mode specification register 2 (TRMC2) and bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1, the TXD2 pin outputs a high level. If bit 6 (TXE2) of ASIM2 is set to 1 next, transmission is enabled. Transmission can be started by writing transmit data to transmit buffer register 2 (TXB2). The start bit, parity bit, and stop bit are automatically appended to the transmit data. When transmission has been started, the data in TXB2 is transferred to transmit shift register 2 (TXS2) and is sequentially output to the TXD2 pin, starting from the LSB. If the data to be transmitted next has been written to TXB2 by the time transmission is complete, transmitting the next data is started. If no more data has been written to TXB2, transmission is stopped until the next data is written. Figure 15-13 illustrates the timing of the transmit interrupt. Figure 15-13. Timing of Asynchronous Serial Interface Transmit Completion Interrupt Request (i) Stop bit length: 1 bit, TRMC2: ISMD2 = 0
TxD2 (output)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTST2
(ii) Stop bit length: 2 bits, TRMC2: ISMD2 = 0
TXD2 (output)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTST2
(iii) Successive transmission, Stop bit length: 2 bits, TRMC2: ISMD2 = 1
If next transmit data is written to TXB2
TxD2 (output)
Start
D0
D1
D7
Parity
Stop
Start
D0
INTST2
Remark TRMC2: Transfer mode specification register 2 ISMD2: Bit 3 of TRMC2
User's Manual U14260EJ3V1UD
289
CHAPTER 15
SERIAL INTERFACE UART2
Caution
Do not rewrite asynchronous serial interface mode register 2 (ASIM2) during a transmit operation. Rewriting the ASIM2 register during a transmit operation may disable further transmit operations (in such cases, input a RESET to restore normal operation).
(d) Successive transmission The next transmit data can be written to transmit buffer register 2 (TXB2) as soon as transmit shift register 2 (TXB2) has started its shift operation. Consequently, even while an interrupt is being serviced after one data frame has been transmitted, data can be successively transmitted. To successively transmit data, be sure to check, by using asynchronous serial interface transmit status register 2 (ASIF2), the transmission status and whether writing to TXB2 is enabled or disabled, and then write the data to TXB2. The following table shows the relationship between the transmission status and writing to TXB2. Table 15-5. Writing to TXBF and TXB2 (When Successive Transmission Is Started)
TXBF 0 1 Enabled Disabled Writing to TXB2 When Successive Transmission Is Started
Caution
When starting successive transmission, write the first byte of data to transmit buffer register 2 (TXB2), and then make sure to write data to TXB2 again.
Remark TXBF: Bit 1 of ASIF2 Table 15-6. Writing to TXSF and TXB2 (When Successive Transmission Is in Progress)
TXSF 0 1 Writing to TXB2 When Successive Transmission Is in Progress Two-byte writing or transmit completion processing enabled One-byte writing enabled
Cautions 1. When successive transmission is in progress, the processing of writing to TXB2 can be confirmed by checking the value of TXSF after the transmit completion interrupt. * TXSF = 1: Successive transmission in progress. One-byte data can be written. * TXSF = 0: Successive transmission is complete. Two-byte data can be written. When writing, note the Caution in Table 15-5. 2. To initialize (to set TXE2 to 0 or POWER2 to 0) during successive transmission, make sure that TXSF is 0 after the transmit completion interrupt, then initialize.
290
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-14 shows the processing flow of successive transmission. Figure 15-14. Processing Flow of Successive Transmission
START
Set various registers
Write data to TXB2
Read ASIF2
No
TXBF = 0? Yes Interrupt occurred
No
Required number of writes performed? Yes
Read ASIF2
Read ASIF2
No
TXSF = 1? Yes Write data to TXB2
No
TXSF = 0? Yes Completion of transmission processing
Wait for occurrence of interrupt
User's Manual U14260EJ3V1UD
291
CHAPTER 15
SERIAL INTERFACE UART2
The following figures and tables show the timing of starting and completing successive transmission. Figure 15-15. Timing of Starting Successive Transmission
TXD2 (output) <1>
Start <2>
Data (1)
Parity Stop <3>
Start <4>
Data (1)
Parity Stop <5>
Start
INTST2
TXB2
FF
Data (1) Data transfer
Data (2) Data transfer
Data (3) Data transfer Data (2) Data (3)
TXS2
FF
Data (1)
TXBF
TXSF
Table 15-7. Timing of Starting Successive Transmission
Transmission Procedure Set transmission mode. Write data (1). <2> Generates start bit and starts transmitting data (1). Read ASIF2 (to confirm TXBF = 0) and write data (2). (during transmission) <3> Interrupt (INTST2) occurs. Read ASIF2 (to confirm TXBF = 0) and write data (3). <4> Generates start bit and starts transmitting data (2). (during transmission) <5> Interrupt (INTST2) occurs. Read ASIF2 (to confirm TXBF = 0) and write data (3). 0 1 1 1 0 1 1 1 Internal Operation <1> Starts transmission unit. TXBF 0 1 0 TXSF 0 0 1
1
1
Remarks 1. <1> to <5> in this table correspond to <1> to <5> in Figure 15-15. 2. TXBF: Bit 1 (transmit buffer data flag) of asynchronous serial interface transmit status register 2 (ASIF2) TXSF: Bit 0 of ASIF2 (transmit shift register data flag)
292
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-16. Timing of Completing Successive Transmission
TXD2 (output)
Parity Stop Start Data (n - 1) Parity Stop Start Data (n - 1) Parity <1> <2> <3> <4> <5> <6>
Stop POWER2 or TXE2 is cleared.
INTST2 Data (n - 1)
Data transfer
TXB2
Data (n)
Data transfer
TXS2
Data (n - 1)
Data (n)
FF
TXBF
TXSF
Table 15-8. Timing of Completing Successive Transmission
Transmission Procedure Internal Operation <1> Data (n-2) is transmitted. <2> Interrupt (INTST2) occurs. Read ASIF2 (to confirm TXBF = 0) and write data (n). <3> Generates start bit and starts transmitting data (n-1). (during transmission) <4> Interrupt (INTST2) occurs. Read ASIF2 (to confirm TXBF = 0). No data to be written. <5> Generates start bit and starts transmitting data (n). (during transmission) <6> Interrupt (INTST2) occurs. Read ASIF2 (to confirm TXBF = 0) and clear POWER2 or TXE2. Initializes internal circuit. 0 0 0 1 1 1 TXBF 1 0 1 TXSF 1 1 1
Remarks 1. <1> to <6> in this table correspond to <1> to <6> in Figure 15-16. 2. TXBF: TXSF: TXE2: Bit 1 (transmit buffer data flag) of asynchronous serial interface transmission status register 2 (ASIF2) Bit 0 of ASIF2 (transmit shift register data flag) Bit 6 of ASIM2 POWER2: Bit 7 of asynchronous serial interface mode register 2 (ASIM2)
User's Manual U14260EJ3V1UD
293
CHAPTER 15
SERIAL INTERFACE UART2
(d) Reception The interface enters the reception wait status if the UART transfer mode is specified by using transfer mode specification register 2 (TRMC2) and bit 5 (RXE2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1 after bit 7 (POWER2) has been set to 1. In this status, the RXD2 pin is monitored to detect the start bit. When the start bit is detected, reception is started, and serial data is sequentially stored in receive shift register 2 (RX2) at the specified baud rate. When the stop bit is received, a receive completion interrupt (INTSR2) occurs and, at the same time, the data in RX2 is written to receive buffer register 2 (RXB2). If an overrun error (OVE2) occurs, however, the receive data is not written to RXB2 but discarded. Even if a parity error (PE2) or framing error (FE2) occurs during reception, reception continues up to the position at which the stop bit is received, and an error interrupt (INTSR2/INTSER2) occurs after completion of reception. Figure 15-17. Timing of Asynchronous Serial Interface Receive Completion Interrupt Request
RxD2 (input)
Start
D0
D1
D2
D6
D7
Parity
Stop
INTSR2
RXB2
Caution
During reception, the number of stop bits is always 1. A second stop bit is ignored.
294
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(e) Receive errors Three types of errors can occur during a receive operation: a parity error, framing error, or overrun error. If, as the result of data reception, an error flag is set in asynchronous serial interface status register 2 (ASIS2), a receive error interrupt request (INTSR2/INTSER2) will occur. Table 15-9 lists the causes behind receive errors. As part of receive error interrupt request (INTSR2/INTSER2) servicing, the contents of ASIS2 can be read to determine which type of error occurred during the receive operation (see Table 15-9 and Figure 15-18). The contents of ASIS2 are reset (to 0) when receive buffer register 2 (RXB2) is read or when the next data is received (if the next data contains an error, its error flag will be set). Table 15-9. Causes of Receive Errors
Receive Error Parity error Framing error Overrun error Cause Specified parity does not match parity of receive data Stop bit was not detected Reception of the next data was completed before data was read from receive buffer register 2 (RXB2)
Caution
Even if data is written to TXB2 when data remains in transmit buffer register 2 (TXB2), an overrun error will not occur. Figure 15-18. Receive Error Timing
RxD0 (input)
START
D0
D1
D2
D6
D7
Parity
STOP
INTSR2 or INTSER2Note
Cautions 1. The contents of asynchronous serial interface status register 2 (ASIS2) are reset (to 0) when receive buffer register 2 (RXB2) is read or when the next data is received. To obtain information about the error, be sure to read the contents of ASIS2 before reading RXB2. 2. Be sure to read the contents of receive buffer register 2 (RXB2) even when a receive error has occurred. Overrun errors will occur during the next data receive operations and the receive error status will remain until the contents of RXB2 are read. Note The interrupts can be divided into INTSR2 and INTSER2 by setting bit 0 (ISEM2) of asynchronous serial interface mode register 2 (ASIM2) to 1.
User's Manual U14260EJ3V1UD
295
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-19. INTSR2 and INTSER2 (1) If ISEM2 is cleared to 0 (error interrupt is included in INTSR2) (a) No error at reception (b) Error at reception
INTSR2
INTSR2
INTSER2
INTSER2
(2) If ISEM2 is set to 1 (to separate INTSR2 and INTSER2) (a) No error at reception (b) Error at reception
INTSR2
INTSR2
INTSER2
INTSER2
296
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
15.4.3 Multi-processor transfer mode In this mode, data can be transferred to or received from two or more processors. (1) Registers to be used * Asynchronous serial interface mode register 2 (ASIM2) * Asynchronous serial interface status register 2 (ASIS2) * Baud rate generator control register 2 (BRGC2) * Asynchronous serial interface transmit status register 2 (ASIF2) * Clock select register 2 (CKSEL2) * Transfer mode specification register 2 (TRMC2) * Port mode register 3 (PM3) * Port register 3 (P3) The basic procedure of setting an operation in the multi-processor transfer mode is as follows. <1> Set the CKSEL2 register (see Figure 15-7). <2> Set the BRGC2 register (see Figure 15-6). <3> Set bits 7 and 6 (TRM12 and TRM02) of the TRMC2 register to 0 and 1, and set bits 3, 1, and 0 (ISMD2, MPIEN2, and MPS2) (see Figure 15-8). <4> Set bits 4 to 0 (PS21, PS20, CL2, SL2, and ISEM2) of the ASIM2 register (see Figure 15-3). <5> Set bit 7 (POWER2) of the ASIM2 register to 1. <6> Set bit 6 (TXE2) of the ASIM2 register to 1. Transmission is enabled. <7> Set bit 5 (RXE2) of the ASIM2 register to 1. Reception is enabled. <8> Write data to TXB2. Data transmission is started. Caution Take relationship with the other party of communication when setting the port mode register and port register. The relationship between the register settings and pins is shown below. Table 15-10. Relationship Between Register Settings and Pins (Multi-Processor Transfer Mode)
ASIM2 POW TXE2 RXE2 PS21 PS20 ER2 1 1 1 0 1 1 1 0 1 0/1 0/1 0/1 0/1 0/1 0/1 CL2 TRMC2 SL2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 PM34 P34 PM35 P35 Operation Pin Function Mode P34/ SI3/ TxD2 P35/ SO3/ RxD2 RxD2 P35 RxD2
0/1 0/1 0/1
x 0/1 0/1
0/1 x 0/1
0 0 0
1 1 1
x 0/1 0/1
0/1 0/1 0/1
0/1 0/1 0/1
xNote xNote 0 0 0 0
1 xNote 1
x xNote x
Reception P34 Transmission TxD2 Transmission/ TxD2 reception
Note
Can be set as port function.
Caution When using UART2, stop the operation of SIO3 (bit 7 (CSIE3) of serial operation mode register 3 (CSIM3) = 0). Remark x: don't care, ASIM2: Asynchronous serial interface mode register 2, TRMC2: Transfer mode specification register 2, PMxx: Port mode register, Pxx: Port output latch
User's Manual U14260EJ3V1UD
297
CHAPTER 15
SERIAL INTERFACE UART2
For an explanation how to generate the transmit/receive clock for the baud rate and details of the permissible error range of the baud rate, refer to (1) Registers to be used in 15.4.2 Asynchronous serial interface (UART) mode. (2) Communication operations (a) Data format Figure 15-20 shows an example of the transmit/receive data format. Figure 15-20. Example of Transmit/Receive Data Format in Multi-Processor Transfer Mode (1) ID transfer (multi-processor appended bit = 1) format Character bit: 8 bits, No parity, Stop bit: 1 bit, Communication data: 55H
1 data frame
Start bit
D0
D1
D2
D3
D4
D5
D6
D7
Appended bit
Stop bit
Character bit
(2) Data transfer (multi-processor appended bit = 0) format Character bit: 8 bits, Parity bit: odd parity, Stop bit: 1 bit, Communication data: 55H
1 data frame
Start bit
D0
D1
D2
D3
D4
D5
D6
D7
Appended bit
Parity bit
Stop bit
Character bit
Caution
If parity is specified, the parity bit is output after the multi-processor appended bit. In this case, the multi-processor appended bit is subject to parity calculation during both transmission and reception.
298
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
One data frame consists of the following bits: * Start bit ........................................... 1 bit * Character bit ................................... 7/8 bits (LSB first) * Multi-processor appended bit ........ 1 bit (set to 1 or 0) * Parity bit .......................................... Even/odd/0/none * Stop bit ........................................... 1/2 bits The character bit length, parity, and stop bit length in one data frame are selected by asynchronous interface mode register 2 (ASIM2). Data is transferred starting from the LSB. The multi-processor appended bit of transmit data is specified by transfer mode specification register 2 (TRMC2). The serial transfer rate is selected by baud rate generator control register 2 (BRGC2) and clock select register 2 (CKSEL2). If an error occurs when receiving serial data, the error can be determined by reading the status of asynchronous serial interface status register 2 (ASIS2).
User's Manual U14260EJ3V1UD
299
CHAPTER 15
SERIAL INTERFACE UART2
(b) Transmission If the multi-processor transfer mode is set by using transfer mode specification register 2 (TRMC2) and bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1, the TxD2 pin outputs a high level. If bit 6 (TXE2) of ASIM2 is set to 1 next, transmission is enabled. Transmission (ID transmission) can be started by setting bit 0 (MPS2) of TRMC2 to 1 and writing transmit data to transmit buffer register 2 (TXB2). Next, confirm that bit 1 (TXBF) of asynchronous serial interface transmit status register 2 (ASIF2) is 0. Then clear MPS and write transmit data to TXB2 (data transmission). The start bit, multi-processor transfer appended bit, parity bit, and stop bit are automatically appended to the data. When transmission is started, the data in TXB2 is transferred to transmit shift register 2 (TXS2) and sequentially output to the TxD2 pin, starting from the LSB. If the data to be transmitted next has been written to TXB2 by the time transmission is complete, transmitting the next data is started. If no more data has been written to TXB2, transmission is stopped until new transmit data is written. Figure 15-21 shows the timing of a transmit interrupt. Figure 15-21. Timing of Transmit Completion Interrupt Request in Multi-Processor Transfer Mode
ID transmit frame TxD2 (output)
Start D0 ... D7 MPS2 Stop Start
Data transmit frame
D0 ... D7 MPS2 Stop Start
INTST2
TXB2
FF
Data 1 (ID) Data transfer
Data 2 (data) Data transfer
Data 3 (data)
TXS2
FF
Data 1 (ID data)
Data 2 (data)
CPU
MPS2 1
TXB2 data 1 (ID)
MPS2 0
TXB2 data 2 (data)
TXB2 data 3 (data)
MPS2
Caution
Before writing transmit data to TXB2, confirm that TXBF = 0 and set or clear the MPS bit. If the MPS bit is set or cleared with TXBF = 1, the set data of the MPS bit may be appended to the transmit data currently in TXB2 and transferred.
300
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(c) Reception The interface enters the reception wait status if the multi-processor transfer mode is specified by using transfer mode specification register 2 (TRMC2) and bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1 and then bit 5 (RXE2) is set to 1. In this status, the RXD2 pin is monitored to detect the start bit. When the start bit is detected, reception is started, and serial data is sequentially stored in receive shift register 2 (RX2) at the specified baud rate. If data with the multi-processor appended bit set to "1" is received (ID reception), a receive completion interrupt (INTSR2) occurs after the stop bit has been detected and, at the same time, the data in RX2 is written to receive buffer register 2 (RXB2). At this time, bit 3 (MPR2) of asynchronous serial interface register 2 (ASIS2) is set to 1. After it has been confirmed that MPR2 is 1, the ID of the receive data and the ID of the microprocessor are compared (for which software processing is necessary). If the two IDs match, the interface prepares for the next reception and waits for the next receive completion interrupt (INTSR2). If the IDs do not match, clear bit 1 (MPIEN2) of transfer mode specification register 2 (TRMC2) to 0. This makes receive data other than ID invalid and prevents occurrence of an unwanted receive completion interrupt (INTSR2). Figure 15-22. Timing of Receive Completion Interrupt Request in Multi-Processor Transfer Mode (1/2) (1) If receive data matches ID
ID receive frame RxD2 (input)
Start D0 ... D7 MPR2 Stop Start
Data receive frame
D0 ... D7 MPR2 Stop Start D0
INTSR2
RXB2
1
FF
Data 1 (ID)
Data 2 (data)
MPIEN2
CPU
MPR2 1
RXB2 data 1 (ID) IDs match. Prepares for reception and waits for INTSR2.
RXB2 data 2 (data)
MPR2
User's Manual U14260EJ3V1UD
301
CHAPTER 15
SERIAL INTERFACE UART2
Figure 15-22. Timing of Receive Completion Interrupt Request in Multi-Processor Transfer Mode (2/2) (2) If receive data does not match ID
ID receive frame RXD2 (input)
Start D0 ... D7 MPR2 Stop Start
Data receive frame
D0 ... D7 MPR2 Stop Start D0
INTSR2
RXB2
1
FF
Data 1 (ID)
MPIEN2
CPU
MPR2 1
RXB2 data 1 (ID) IDs do not match.
Clears MPIEN2
MPR2
302
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
15.4.4 Infrared data transfer (IrDA) mode In this mode, pulses can be output, transmitted, or received in the data format of the IrDA specifications. This mode can be used to transmit or receive data to or from a digital device such as a personal computer. (1) Registers to be used * Asynchronous serial interface mode register 2 (ASIM2) * Asynchronous serial interface status register 2 (ASIS2) * Baud rate generator control register 2 (BRGC2) * Asynchronous serial interface transmit status register 2 (ASIF2) * Clock select register 2 (CKSEL2) * Transfer mode specification register 2 (TRMC2) * Port mode register 3 (PM3) * Port register 3 (P3) The relationship between the register settings and pins is shown below. Table 15-11. Relationship Between Register Settings and Pins (Infrared Data Transfer (IrDA) Mode)
ASIM2 POW TXE2 RXE2 PS21 PS20 ER2 1 1 1 0 1 1 1 0 1 0/1 0/1 0/1 0/1 0/1 0/1 CL2 TRMC2 SL2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 PM34 P34 PM35 P35 Operation Pin Function Mode P34/ SI3/ TxD2 P35/ SO3/ RxD2 RxD2 P35 RxD2
0/1 0/1 0/1
x 0/1 0/1
0/1 x 0/1
1 1 1
x x x
x 0/1 0/1
x x x
x x x
xNote xNote 0 0 0 0
1 xNote 1
x xNote x
Reception P34 Transmission TxD2 Transmission/ TxD2 reception
Note
Can be set as port function. When using UART2, stop the operation of SIO3 (bit 7 (CSIE3) of serial operation mode register 3 (CSIM3) = 0). 2. To transfer data in the infrared data transfer (IrDA) mode, the following conditional expression must be satisfied for the transmit pulse width. (Conditional expression) 1.41 s Transmit pulse width (set values of TPW20 to TPW23) < Transfer rate (set values of MDL20 to MDL27)
Cautions 1.
Remark x: don't care, ASIM2: Asynchronous serial interface mode register 2, TRMC2: Transfer mode specification register 2, PMxx: Port mode register, Pxx: Port output latch, TPW20 to TPW23: Bits 0 to 3 of clock select register 2 (CKSEL2), MDL20 to MDL27: Bits 0 to 7 of baud rate generator control register 2 (BRGC2)
User's Manual U14260EJ3V1UD
303
CHAPTER 15
SERIAL INTERFACE UART2
(2) Communication operation (a) Data format Figure 15-23 shows the format of transmit/receive data. Figure 15-23. Example of Transmit/Receive Data Format in Infrared Data Transfer (IrDA) Mode (1) IrDA standard format (Character bit: 8 bits, Parity bit: None, Stop bit: 1 bit, Communication data: 55H)
1 data frame Character bit Start bit D0 D1 D2 D3 D4 D5 D6 D7 Stop bit
Bit time
Pulse width
(2) Other format (Character bit: 7 bits, Parity bit: Even parity, Stop bit: 2 bits, Communication data: 55H)
1 data frame Character bit Start bit D0 D1 D2 D3 D4 D5 D6 Parity Stop bit
Bit time
Pulse width
304
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
One data frame consists of the following bits: * Start bit .............. 1 bit * Character bit ...... 7/8 bits (LSB first) * Parity bit ............. Odd/even/0/None * Stop bit .............. 1/2 bits The character bit length, parity, and stop bit length in one data frame are specified by using asynchronous serial interface mode register 2 (ASIM2). Data is transferred starting from the LSB. The length of the electric pulse transmitted or received in one data frame can be specified by using bits 0 to 3 (TPW20 to TPW23) of clock select register 2 (CKSEL2). Usually, the pulse length is 1.41 s (rated minimum pulse width) to lower the power consumption. The pulse bit rises at the center of a bit cycle.
User's Manual U14260EJ3V1UD
305
CHAPTER 15
SERIAL INTERFACE UART2
(b) Transmission If the infrared data transfer (IrDA) mode is set by using transfer mode specification register 2 (TRMC2) and bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1, clock operation is enabled, and the TXD2 pin outputs a low level. If bit 6 (TXE2) of ASIM2 is set to 1 next, transmission is enabled. Transmission can be started by writing transmit data to transmit buffer register 2 (TXB2). The start bit, parity bit, and stop bit are automatically appended to the data. When transmission is started, the data in TXB2 is transferred to transmit shift register 2 (TXS2) and sequentially output to the TXD2 pin, starting from the LSB. If the data to be transmitted next has been written to TXB2 by the time transmission is complete, transmitting the next data is started. If no more data has been written to TXB2, transmission is stopped until new transmit data is written. Figure 15-24 shows the timing of a transmit interrupt. Figure 15-24. Timing of Transmit Completion Interrupt Request in Infrared Data Transfer (IrDA) Mode (1) Character bit: 8 bits, Parity bit: Odd parity, Stop bit: 1 bit, Communication data: 7DH, TRMC2: ISMD2 = 0
Start TXD2 (output)
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
INTST2
(2) Character bit: 8 bits, Parity bit: Even parity, Stop bit: 2 bits, Communication data: 9BH, TRMC2: ISMD2 = 0
Start TXD2 (output)
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
INTST2
Remark TRMC2: Transfer mode specification register 2 ISMD2: Bit 3 of TRMC2
306
User's Manual U14260EJ3V1UD
CHAPTER 15
SERIAL INTERFACE UART2
(c) Reception The interface enters the reception wait status if the infrared data transfer (IrDA) mode is specified by using transfer mode specification register 2 (TRMC2) and bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) is set to 1 and then bit 5 (RXE2) is set to 1. In this status, the RXD2 pin is monitored to detect the start bit. When the start bit is detected, reception is started, and serial data is sequentially stored in receive shift register 2 (RX2) at the specified baud rate. When the stop bit is received, the data in RX2 is written to receive buffer register 2 (RXB2). If an overrun error (OVE2) occurs, however, the receive data is not written to RXB2 but discarded. Even if a parity error (PE2) or framing error (FE2) occurs during reception, reception continues up to the position at which the stop bit is received, and an error interrupt (INTSR2/INTSER2) occurs after completion of reception. Figure 15-25. Timing of Receive Completion Interrupt Request in Infrared Data Transfer (IrDA) Mode
Start RXD2 (input)
D0
D1
D2
D3
D4
D5
D6
D7
Parity
Stop
INTSR2
RXB2
76H
Cautions 1. Be sure to read receive buffer register 2 (RXB2) even if a reception error has occurred. Otherwise, an overrun error will occur when the next data is received, and the reception error status will persist. 2. The number of stop bits is always 1 during reception. A second stop bit is ignored. (d) Bit rate and pulse width Table 15-12 shows the bit rate and pulse width in the infrared data transfer (IrDA) mode. The rated minimum pulse width is 1.41 s, and the maximum pulse width is the sum of 3/16 of the bit rate and 2.5% of the bit cycle or 1.08 s, whichever is greater. Table 15-12. Bit Rate and Pulse Width
Bit Rate (bps) Allowable Bit Rate Error (% of Bit Rate) Minimum Pulse Width (s) Nominal Value of 3/16 of Pulse Width (s) 78.13 19.53 9.77 4.88 3.26 1.63 Maximum Pulse Width (s)
2400 9600 19200 38400 57600 115200
+/-0.87
1.41
88.55 22.13 11.07 5.96 4.34 2.71
User's Manual U14260EJ3V1UD
307
308
(1) Operation stop mode CSIM3 CSIE3 POWER2 TXE2 0Note 1 0 0 RXE2 0 ASIM2 PS21 x PS20 x CL2 x SL2 x x
Table 15-13. Register Settings (1/2)
TRMC2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 x x x x x
PM34
P34
PM35
P35
Pin Function P34/SI3/TxD2 P35/SO3/RxD2
Operation Mode Stop
xNote 2
xNote 2
xNote 2
xNote 2
P34
P35 Setting prohibited
Other than above
(2) Asynchronous serial interface (UART) mode
CSIM3 CSIE3 POWER2 TXE2 0
Note 1
ASIM2 RXE2 1 0 1 PS21 0/1 0/1 0/1 PS20 0/1 0/1 0/1 CL2 0/1 0/1 0/1 SL2 x 0/1 0/1
TRMC2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 0/1 x 0/1 0 0 0 0 0 0 x 0/1 0/1 x x x x x x
PM34
P34
PM35
P35
Pin Function P34/SI3/TxD2 P35/SO3/RxD2
Operation Mode Receive Transmit Transmit/receive
CHAPTER 15
1 1 1
0 1 1
x
Note 2
x
Note 2
1 xNote 2 1
x xNote 2 x
P34 TxD2 TxD2
RxD2 P35 RxD2 Setting prohibited
0Note 1
User's Manual U14260EJ3V1UD
0 0
0 0
0Note 1
Other than above
SERIAL INTERFACE UART2
Notes 1. When using UART2, stop the SIO3 operation. 2. Can be set as port function. Remark x: Don't care, CSIM3: Serial operation mode register 3, ASIM2: Asynchronous serial interface mode register 2, TRMC2: Transfer mode specification register 2, PMxx: Port mode register, Pxx: Output latch of port
Table 15-13. Register Settings (2/2)
(3) Multi-processor transfer mode
CSIM3 CSIE3 POWER2 TXE2 0Note 1 0Note 1 0
Note 1
ASIM2 RXE2 1 0 1 PS21 0/1 0/1 0/1 PS20 0/1 0/1 0/1 CL2 0/1 0/1 0/1 SL2 x 0/1 0/1
TRMC2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 0/1 x 0/1 0 0 0 1 1 1 x 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1
PM34
P34
PM35
P35
Pin Function P34/SI3/TxD2 P35/SO3/RxD2 RxD2 P35 RxD2 Setting prohibited
Operation Mode Receive Transmit Transmit/receive
1 1 1
0 1 1
xNote 2 0 0
xNote 2 0 0
1 xNote 2 1
x xNote 2 x
P34 TxD2 TxD2
Other than above
(4) Infrared data transfer (IrDA) mode
CHAPTER 15
CSIM3 CSIE3 POWER2 TXE2 0Note 1 0Note 1 0Note 1 1 1 1 0 1 1
User's Manual U14260EJ3V1UD
ASIM2 RXE2 1 0 1 PS21 0/1 0/1 0/1 PS20 0/1 0/1 0/1 CL2 0/1 0/1 0/1 SL2 x 0/1 0/1
TRMC2 ISEM2 TRM12 TRM02 ISMD2 MPIEN2 MPS2 0/1 x 0/1 1 1 1 x x x x 0/1 0/1 x x x x x x
PM34
P34
PM35
P35
Pin Function P34/SI3/TxD2 P35/SO3/RxD2 RxD2 P35 RxD2 Setting prohibited
Operation Mode Receive Transmit Transmit/receive
xNote 2 0 0
xNote 2 0 0
1 xNote 2 1
x xNote 2 x
P34 TxD2 TxD2
SERIAL INTERFACE UART2
Other than above
Notes 1. When using UART2, stop the SIO3 operation. 2. Can be set as port function. Caution When transferring in infrared data transfer (IrDA) mode, the following conditional expression must be satisfied for specification of the transmit pulse width. (Conditional expression) 1.41 s Transmit pulse width (set values of TPW20 to TPW23 in CKSEL2 register) < Transfer rate (set values of MDL20 to MDL27 in BRGC2 register) Remark x: Don't care, CSIM3: Serial operation mode register 3, ASIM2: Asynchronous serial interface mode register 2, TRMC2: Transfer mode specification register 2, CKSEL2: Clock select register 2, BRGC2: Baud rate generator control register 2, PMxx: Port mode register, Pxx: Output latch of port
309
CHAPTER 16
SERIAL INTERFACE SIO3
Serial interface UART2/SIO3 can be used in the asynchronous serial interface (UART) mode or 3-wire serial I/O mode. Caution Do not enable UART2 and SIO3 at the same time.
16.1
Functions of Serial Interface SIO3
The serial interface SIO3 has the following two modes. (1) Operation stop mode This mode is used when serial transfers are not performed to reduce power consumption. For details, see 16.4.1 Operation stop mode. (2) 3-wire serial I/O mode (fixed as MSB first) This is an 8-bit data transfer mode using three lines: a serial clock line (SCK3), serial output line (SO3), and serial input line (SI3). Since simultaneous transmit and receive operations are enabled in 3-wire serial I/O mode, the processing time for data transfers is reduced. The first bit of the serially transferred 8-bit data is fixed as the MSB. 3-wire serial I/O mode can be used when connecting an IC incorporating a clocked serial interface, or a display controller, etc. For details, see 16.4.2 3-wire serial I/O mode. Figure 16-1 shows a block diagram of serial interface SIO3. Figure 16-1. Block Diagram of Serial Interface SIO3
Internal bus 8 SI3/TXD2/P34 Serial I/O shift register 3 (SIO3) Output latch Serial clock counter Serial clock controller Interrupt request signal generator
SO3/RXD2/P35
SCK3/ASCK2/P36
INTCSI3
3
Selector
fX/24 fX/2 fX/25
310
User's Manual U14260EJ3V1UD
CHAPTER 16
SERIAL INTERFACE SIO3
16.2
Configuration of Serial Interface SIO3
Serial interface SIO3 includes the following hardware. Table 16-1. Configuration of Serial Interface SIO3
Item Register Configuration Serial I/O shift register 3 (SIO3) Interrupt request signal generator Serial clock controller Serial operation mode register 3 (CSIM3) Port mode register 3 (PM3) Port register 3 (P3)
Control registers
(1) Serial I/O shift register 3 (SIO3) This is an 8-bit register that performs parallel-serial conversion and serial transmit/receive (shift operations) synchronized with the serial clock. When bit 7 (CSIE3) of serial operation mode register 3 (CSIM3) is set to 1, a serial operation can be started by writing data to or reading data from SIO3. When transmitting, data written to SIO3 is output to the serial output (SO3). When receiving, data is read from the serial input (SI3) and written to SIO3. SIO3 is set by an 8-bit memory manipulation instruction. RESET input makes SIO3 undefined. Caution Do not access SIO3 during a transfer operation unless the access is triggered by a transfer start (read operations are disabled when MODE3 = 0 and write operations are disabled when MODE3 = 1).
16.3
Registers to Control Serial Interface SIO3
Serial interface SIO3 is controlled by the following three registers. * Serial operation mode register 3 (CSIM3) * Port mode register 3 (PM3) * Port register 3 (P3) (1) Serial operation mode register 3 (CSIM3) This register is used to set SIO3's serial clock and operation modes, and to enable/disable operation of SIO3. CSIM3 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CSIM3 to 00H.
User's Manual U14260EJ3V1UD
311
CHAPTER 16
SERIAL INTERFACE SIO3
Figure 16-2. Format of Serial Operation Mode Register 3 (CSIM3)
Address: FFB8H After reset: 00H Symbol CSIM3 7 CSIE3 6 0 R/W 5 0 4 0 3 0 2 MODE3 1 SCL31 0 SCL30
Enable/disable specification for SIO3 CSIE3 Shift register operation 0 1 Operation disabled Operation enabled Clear Count operation enabled Serial counter Port Port functionNote 1 Serial function + port functionNote 2
Transfer operation modes and flags MODE3 Operation mode 0 1 Transmit/transmit and receive mode Receive-only mode Transfer start trigger Write to SIO3 Read from SIO3 SO3/P35/RxD2 pin function SO3 P35Note 3
SCL31
SCL30
Clock selection fX = 8.38 MHz fX = 12 MHzNote 4 - 1.50 MHz 750 kHz 375 kHz
0 0 1 1
0 1 0 1
External clock input to SCK3 fX/23 fX/24 fX/25
- 1.04 MHz 523 kHz 261 kHz
Notes 1. When CSIE3 = 0 (SIO3 operation stopped status), the SI3, SO3, and SCK3 pins can be used as UART2 or for port functions. 2. When CSIE3 = 1 (SIO3 operation enabled status), the SI3 pin can be used as a port pin if only the transmit function is used, and the SO3 pin can be used as a port pin if only the receive-only mode is used. 3. When MODE3 = 1 (receive-only mode), the SO3 pin can be used for port functions. 4. Expanded-specification products of PD780078 Subseries only. Caution Do not rewrite the value of CSIM3 during transfer. However, CSIE3 can be rewritten using a 1-bit memory manipulation instruction. Remark fX: Main system clock oscillation frequency
312
User's Manual U14260EJ3V1UD
CHAPTER 16
SERIAL INTERFACE SIO3
(2) Port mode register 3 (PM3) PM3 is a register that sets the input/output of port 3 in 1-bit units. To use the P35/SO3/RxD2 pin as a serial data output, set PM35 and the output latch of P35 to 0. To use the P34/SI3/TxD2 pin as a serial data input, and the P36/ASCK2/SCK3 pin as a clock input, set PM34 to 1. At this time, the output latches of P34 and P36 can be either 0 or 1. PM3 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM3 to FFH. Figure 16-3. Format of Port Mode Register 3 (PM3)
Address: FF23H After reset: FFH Symbol PM3 7 1 6 PM36 R/W 5 PM35 4 PM34 3 PM33 2 PM32 1 PM31 0 PM30
PM3n 0 1
I/O mode selection of P3n pin (n = 0 to 6) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
313
CHAPTER 16
SERIAL INTERFACE SIO3
16.4
Operation of Serial Interface SIO3
This section explains the two modes of serial interface SIO3. 16.4.1 Operation stop mode Because serial transfer is not performed during this mode, the power consumption can be reduced. In addition, pins can be used as normal I/O ports. To set the operation stop mode, clear bit 7 (CSIE3) of CSIM3 to 0. (1) Register to be used Operation stop mode is set by serial operation mode register 3 (CSIM3). CSIM3 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CSIM3 to 00H.
Address: FFB8H After reset: 00H Symbol CSIM3 7 CSIE3 6 0
R/W 5 0 4 0 3 0 2 MODE3 1 SCL31 0 SCL30
SIO3 operation enable/disable specification CSIE3 Shift register operation 0 Operation disabled Clear Serial counter Port Port functionNote
Note When CSIE3 = 0 (SIO3 operation stopped status), the SI3, SO3, and SCK3 pins can be used as UART2 or for port functions.
314
User's Manual U14260EJ3V1UD
CHAPTER 16
SERIAL INTERFACE SIO3
16.4.2 3-wire serial I/O mode The 3-wire serial I/O mode can be used when connecting a peripheral IC incorporating a clocked serial interface, a display controller, etc. This mode executes communication via three lines: a serial clock line (SCK3), serial output line (SO3), and serial input line (SI3). (1) Registers to be used * Serial operation mode register 3 (CSIM3) * Port mode register 3 (PM3) * Port register 3 (P3) The basic procedure of setting an operation in the 3-wire serial I/O mode is as follows. <1> Set bits 2 to 0 (MODE3, SCL31, and SCL30) of the CSIM3 register (see Figure 16-2). <2> Set bit 7 (CSIE3) of the CSIM3 register to 1. Transmission/reception is enabled. <3> Write data to the SIO3 register. Data transmission/reception is started. Read data from the SIO3 register. Data reception is started. Caution Take relationship with the other party of communication when setting the port mode register and port register. The relationship between the register settings and pins is shown below. Table 16-2. Relationship Between Register Settings and Pins (3-Wire Serial I/O Mode)
CSIM3 CSIE3 MODE3 SCL31 SCL30 PM34 P34 PM35 P35 PM36 P36 Operation Mode Pin Function P34/ SI3/ TxD2 1 1 0 0 1 xNote 1 x xNote x x xNote x xNote 0 xNote 0 1 x x x 0 Slave reception SI3 P35/ SO3/ P36/ SCK3/
RxD2 ASCK2 P35 SCK3 input SCK3 input SCK3 input SCK3 output SCK3 output SCK3 output
1
0
0
0
1
Slave transmission
P34
SO3
1
0
0
0
0 xNote 0
0 xNote 0
1
Slave transmission/ reception Master reception
SI3
SO3
1
1
Other than above
1 xNote 1
0
SI3
P35
1
0
0
0
Master transmission
P34
SO3
1
0
0
0
0
0
Master transmission/ reception
SI3
SO3
Note
Can be set as port function.
Caution When using SIO3, stop the operation of UART2 (bit 7 (POWER2) of asynchronous serial interface mode register 2 (ASIM2) = 0). Remark x: don't care, CSIM3: Serial operation mode register 3, PMxx: Port mode register, Pxx: Port output latch
User's Manual U14260EJ3V1UD
315
CHAPTER 16
SERIAL INTERFACE SIO3
(2) Transfer start A serial transfer starts when the following two conditions have been satisfied and transfer data has been set (or read) to serial I/O shift register 3 (SIO3). * SIO3 operation control bit (CSIE3) = 1 * After an 8-bit serial transfer, either the internal serial clock is stopped or SCK3 is set to high level. * Transmit/transmit and receive mode (MODE3 = 0) Transfer starts when writing to SIO3. * Receive-only mode (MODE3 = 1) Transfer starts when reading from SIO3. Caution After data has been written to SIO3, transfer will not start even if the CSIE3 bit value is set to 1. (3) Communication operations In the 3-wire serial I/O mode, data is transmitted and received in 8-bit units. Each bit of data is transmitted or received in synchronization with the serial clock. Serial I/O shift register 3 (SIO3) is shifted in synchronization with the falling edge of the serial clock. Transmission data is held in the SO3 latch and is output from the SO3 pin. Data that is received via the SI3 pin in synchronization with the rising edge of the serial clock is latched to SIO3. Figure 16-4. Timing of 3-Wire Serial I/O Mode
Latched to SIO3 at the SCK3 rising edge
SCK3 SI3 SO3 CSIIF3
1 DI7 DO7
2 DI6 DO6
3 DI5 DO5
4 DI4 DO4
5 DI3 DO3
6 DI2 DO2
7 DI1 DO1
8 DI0 DO0
Transfer completion Transfer starts in synchronization with the SCK3 falling edge
(4) Transfer completion Completion of an 8-bit transfer automatically stops the serial transfer operation and the interrupt request flag (CSIIF3) is set.
316
User's Manual U14260EJ3V1UD
Table 16-3. Register Settings
(1) Operation stop mode
ASIM2 POWER2 0
Note 1
CSIM3 CSIE3 0 MODE3 x SCL31 x SCL30 x
PM34
P34
PM35
P35
PM36
P36
Pin Function P34/SI3/TxD2 P35/SO3/RxD2 P36/SCK3/ASCK2
Operation Mode Stop
x
Note 2
x
Note 2
x
Note 2
x
Note 2
x
Note 2
x
Note 2
P34
P35
P36 Setting prohibited
Other than above
(2) 3-wire serial I/O mode
ASIM2 POWER2 0Note 1 0Note 1 0Note 1 0Note 1 0Note 1 0Note 1
User's Manual U14260EJ3V1UD
CSIM3 CSIE3 1 1 1 1 1 1 MODE3 1 0 0 1 0 0 SCL31 0 0 0 SCL30 0 0 0
PM34
P34
PM35
P35
PM36
P36
Pin Function P34/SI3/TxD2 P35/SO3/RxD2 P36/SCK3/ASCK2
Operation Mode
CHAPTER 16
1 xNote 2 1 1 xNote 2 1 Other than above
x xNote 2 x x xNote 2 x
xNote 2 0 0 x 0 0
xNote 2 0 0 x 0 0
1 1 1 0 0 0
x x x 0 0 0
SI3 P34 SI3 SI3 P34 SI3
P35 SO3 SO3 P35 SO3 SO3
SCK3 input SCK3 input SCK3 input SCK3 output SCK3 output SCK3 output Setting prohibited
Slave receive Slave transmit Slave transmit/receive Master receive Master transmit Master transmit/receive
Other than above
SERIAL INTERFACE SIO3
Notes 1. When using SIO3, stop the UART2 operation. 2. Can be set as port function. Remark x: Don't care, ASIM2: Asynchronous serial interface mode register 2, CSIM3: Serial operation mode register 3, PMxx: Port mode register, Pxx: Output latch of port
317
CHAPTER 17
SERIAL INTERFACE CSI1
17.1
Functions of Serial Interface CSI1
Serial interface CSI1 has the following two modes. (1) Operation stop mode This mode is used when serial transfer is not performed. In this mode, the power consumption can be reduced. For details, see 17.4.1 Operation stop mode. (2) 3-wire serial I/O mode (MSB/LSB-first selectable) This mode is used to transfer 8-bit data by using three lines: a serial clock line (SCK1) and two serial data lines (SI1 and SO1). The processing time of data transfer can be shortened in the 3-wire serial I/O mode because transmission and reception can be simultaneously executed. In addition, whether 8-bit data is transferred with the MSB or LSB first can be specified, so this interface can be connected to any device. The 3-wire serial I/O mode can be used when connecting ICs and display controllers having a clocked serial interface. For details, see 17.4.2 3-wire serial I/O mode.
17.2
Configuration of Serial Interface CSI1
Serial interface CSI1 includes the following hardware. Table 17-1. Configuration of Serial Interface CSI1
Item Registers Configuration Transmit buffer register 1 (SOTB1) Serial I/O shift register 1 (SIO1) Transmit controller Clock start/stop controller & clock phase controller Serial operation mode register 1 (CSIM1) Serial clock select register 1 (CSIC1) Port mode register 2 (PM2) Port register 2 (P2)
Control registers
318
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
Figure 17-1. Block Diagram of Serial Interface CSI1
Internal bus
8 SI1/P20 8
Serial I/O shift register 1 (SIO1)
Transmit buffer 8 register 1 (SOTB1)
Output selector
SO1/P21
Transmit data controller
Output latch
Output latch (P21)
Transmit controller
fX/2 fX/22 fX/23 fX/24 fX/25 fX/26 fX/27 SCK1/P22 SS1
Selector
Clock start/stop controller & clock phase controller
INTCSI1
PM21
(1) Transmit buffer register 1 (SOTB1) This register sets transmit data. Transmission is started by writing data to SOTB1 when bit 7 (CSIE1) and bit 6 (TRMD1) of serial operation mode register 1 (CSIM1) are 1. The data written to SOTB1 is converted from parallel data into serial data by serial I/O shift register 1, and output to the serial output (SO1) pin. SOTB1 can be written or read by an 8-bit memory manipulation instruction. RESET input makes SOTB1 undefined. Cautions 1. Do not access SOTB1 when CSOT1 = 1 (during serial communication). 2. The SS1 pin can be used in the slave mode. For details of the transmission/reception operation, see 17.4.2 (2) Communication operation. (2) Serial I/O shift register 1 (SIO1) This is an 8-bit register that converts data from parallel into serial or vice versa. The reception status is entered by reading data from SIO1 if bit 7 (CSIE1) of serial operation mode register 1 (CSIM1) is 1. During reception, data is read from the serial input pin (SI1) to SIO1. SIO1 can be read by an 8-bit memory manipulation instruction. RESET input makes SIO1 undefined. Cautions 1. Do not access SIO1 when CSOT1 = 1 (during serial communication). 2. The SS1 pin can be used in the slave mode. For details of the transmission/reception operation, see 17.4.2 (2) Communication operation.
17.3
Registers to Control Serial Interface CSI1
Serial interface CSI1 is controlled by the following four registers. * Serial operation mode register 1 (CSIM1) * Serial clock select register 1 (CSIC1) * Port mode register 2 (PM2) * Port register 2 (P2)
User's Manual U14260EJ3V1UD
319
CHAPTER 17
SERIAL INTERFACE CSI1
(1) Serial operation mode register 1 (CSIM1) This register is used to select the operation mode and enable or disable operation. CSIM1 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CSIM1 to 00H. Figure 17-2. Format of Serial Operation Mode Register 1 (CSIM1)
Address: FFB0H Symbol CSIM1 After reset: 00H R/WNote 1 7 CSIE1 6 TRMD1 5 SSE1 4 DIR1 3 0 2 0 1 0 0 CSOT1
CSIE1 0 1 Operation disabledNote 2
Control of operation in 3-wire serial I/O mode and internal circuit is asynchronously resetNote 3.
Operation enabled.
TRMD1Note 4 0Note 5 1
Selection of transmit/receive mode Receive-only mode (transmission disabled). Transmit/receive mode
SSE1Notes 6, 7 0 1 Do not use SS1 pin. Use SS1 pin.
Specification of whether SS1 pin is used
DIR1Note 6 0 1 MSB LSB
Specification of first bit
CSOT1 0 1 Communication is stopped. Communication is in progress.
Communication status flag
Notes 1. Bit 0 is a read-only bit. 2. When using the SI1/P20, SO1/P21, SCK1/P22, and SS1/P80 pins as general-purpose port pins, see Caution 2 in Figure 17-3 and Table 17-2. 3. Bit 0 (CSOT1) of CSIM1 and serial I/O shift register 1 (SIO1) are reset. 4. Do not rewrite TRMD1 when CSOT1 = 1 (during serial communication). 5. The SO1 output is fixed to the low level when TRMD1 is 0. Reception is started when data is read from SIO1. 6. Do not rewrite these bits when CSOT1 = 1 (during serial communication). 7. Before setting this bit to 1, fix the input level of the SS1 pin to 0 or 1.
320
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
(2) Serial clock select register 1 (CSIC1) This register is used to specify the data transmission/reception timing and set a serial clock. CSIC1 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets CSIC1 to 10H. Figure 17-3. Format of Serial Clock Select Register 1 (CSIC1)
Address: FFB1H Symbol CSIC1 After reset: 10H R/W 7 0 6 0 5 0 4 CKP1 3 DAP1 2 CKS12 1 CKS11 0 CKS10
CKP1 0
DAP1 0
Specification of data transmission/reception timing
SCK1 SO1 SI1 input timing D7 D6 D5 D4 D3 D2 D1 D0
Type 1
0
1
SCK1 SO1 SI1 input timing D7 D6 D5 D4 D3 D2 D1 D0
2
1
0
3
SCK1 SO1 SI1 input timing
1 1 4
D7 D6 D5 D4 D3 D2 D1 D0
SCK1 SO1 SI1 input timing D7 D6 D5 D4 D3 D2 D1 D0
CKS12
CKS11
CKS10
CSI1 serial clock selection fX = 8.38 MHz fX = 12 6 MHz 3 MHz 1.5 MHz 750 kHz 375 kHz 187.5 kHz 93.75 kHz MHzNote
Mode
0 0 0 0 1 1 1 1
0 0 1 1 0 0 1 1
0 1 0 1 0 1 0 1
fX/2 fX/22 fX/23 fX/24 fX/25 fX/26 fX/27 External clock
4.19 MHz 2.09 MHz 1.04 MHz 523.75 kHz 261.87 kHz 130.94 kHz 65.47 kHz
Master mode
Slave mode
Note Expanded-specification products of PD780078 Subseries only.
User's Manual U14260EJ3V1UD
321
CHAPTER 17
SERIAL INTERFACE CSI1
Cautions 1. 2. 3.
Do not write to CSIC1 when CSIE1 = 1 (operation enabled). When using the P22/SCK1 pin as a general-purpose port pin, set CKP1 to 1. The phase type of the data clock is type 3 after reset.
Remark fx: Main system clock oscillation frequency (3) Port mode registers 2 and 8 (PM2, PM8) PM2 and PM8 are registers that set input/output of ports 2 and 8 in 1-bit units. When using the P21/SO1 pin as a serial data output, set PM21 and the output latch of P21 to 0. When using the P20/SI1 pin as a serial data input, the P22/SCK1 pin as a clock input, and the P80/SS1 pin as a chip select input, set PM20, PM22, and PM80 to 1. At this time, the output latches of P20, P22, and P80 can be either 0 or 1. PM2 and PM8 are set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM2 and PM8 to FFH. Figure 17-4. Format of Port Mode Register 2 (PM2)
Address: FF22H After reset: FFH Symbol PM2 7 1 6 1 R/W 5 PM25 4 PM24 3 PM23 2 PM22 1 PM21 0 PM20
PM2n 0 1
I/O mode selection of P2n pin (n = 0 to 5) Output mode (output buffer on) Input mode (output buffer off)
Figure 17-5. Format of Port Mode Register 8 (PM8)
Address: FF28H After reset: FFH Symbol PM8 7 1 6 1 R/W 5 1 4 1 3 1 2 1 1 1 0 PM80
PM80 0 1
I/O mode selection of P80 pin Output mode (output buffer on) Input mode (output buffer off)
322
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
17.4
Operation of Serial Interface CSI1
The following describes the two modes of serial interface CSI1. 17.4.1 Operation stop mode Serial communication is not executed in this mode, so the power consumption can be reduced. In addition, the P20/SI1, P21/SO1, P22/SCK1, and P80/SS1 pins can be used as ordinary I/O port pins in this mode. To set the operation stop mode, clear bit 7 (CSIE1) of CSIM1 to 0. (1) Register to be used The operation stop mode is set by serial operation mode register 1 (CSIM1). CSIM1 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears CSIM1 to 00H.
Address: FFB0H Symbol CSIM1 After reset: 00H R/W 7 CSIE1 6 TRMD1 5 SSE1 4 DIR1 3 0 2 0 1 0 0 CSOT1
CSIE1 0 Operation disabledNote 1
Control of operation in 3-wire serial I/O mode and internal circuit is asynchronously resetNote 2.
Notes 1. When using the SI1/P20, SO1/P21, SCK1/P22, and SS1/P80 pins as general-purpose port pins, see Caution 2 in Figure 17-3 and Table 17-2. 2. Bit 0 (CSOT1) of CSIM1 and serial I/O shift register 1 (SIO1) are reset. 17.4.2 3-wire serial I/O mode
The 3-wire serial I/O mode can be used when connecting ICs and display controllers having a conventional clocked serial interface. In this mode, communication is executed by using three lines: serial clock (SCK1), serial output (SO1), and serial input (SI1) lines. (1) Registers to be used * Serial operation mode register 1 (CSIM1) * Serial clock select register 1 (CSIC1) * Port mode register 2 (PM2) * Port register 2 (P2)
User's Manual U14260EJ3V1UD
323
CHAPTER 17
SERIAL INTERFACE CSI1
The basic procedure of setting an operation in the 3-wire serial I/O mode is as follows. <1> Set the CSIC1 register (see Figure 17-3). <2> Set bits 6 to 4 and 0 (TRMD1, SSE1, DIR1, and CSOT1) of the CSIM1 register (see Figure 17-2). <3> Set bit 7 (CSIE1) of the CSIM1 register to 1. Transmission/reception is enabled. <4> Write data to the SOTB1 register. Data transmission/reception is started. Read data from the SIO1 register. Data reception is started. Caution Take relationship with the other party of communication when setting the port mode register and port register. The relationship between the register settings and pins is shown below. Table 17-2. Relationship Between Register Settings and Pins (3-Wire Serial I/O Mode)
CSIM1 CSIE1 TRMD1 SSE1 DIR1 x xNote 1 xNote 1 x xNote 1 xNote 1 1 0/1 xNote 1 xNote 1 0 0 1 x x PM20 P20 PM21 P21 PM22 P22 PM80 P80 Operation Mode P20/ SI1 SI1 Pin Function P21/ SO1 P21 P22/ SCK1 SCK1 inputNote 2 P20
Note 2
P80/ SS1 P80 SS1 P80 SS1 P80 SS1 P80
1
0
0 1
0/1
1
1
Slave reception
Note 2
1
1
0 1
xNote 1 xNote 1 1 x x
Note 1
Slave transmission Slave transmission/ receptionNote 2
SO1
SCK1 inputNote 2
1
1
0 1
0/1
1
x
0
0
1
x
x
Note 1
SI1
SO1
SCK1 inputNote 2
1 0/1 1 x xNote 1 xNote 1 0 0 1 x x x
x
1
0
0
xNote 1 xNote 1 xNote 1 xNote 1 xNote 1 xNote 1
Master reception Master transmission Master transmission/ reception
SI1
P21
SCK1 output SCK1 output SCK1 output
1
1
0
0/1 xNote 1 xNote 1 0/1 1 x
1
P20
SO1
P80
1
1
0
0
0
1
SI1
SO1
P80
Notes 1. Can be set as port function. 2. To use the slave mode, set CKS12, CKS11, and CKS10 to 1, 1, 1. Remark x: don't care, CSIM1: Serial operation mode register 1, CKS12, CKS11, CKS10: Bits 2 to 0 of serial clock select register 1 (CSIC1)
324
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
(2) Communication operation In the 3-wire serial I/O mode, data is transmitted or received in 8-bit units. Each bit of data is transmitted or received in synchronization with the serial clock. Data can be transmitted or received if bit 6 (TRMD1) of serial operation mode register 1 (CSIM1) is 1. Transmission/reception is started when a value is written to transmit buffer register 1 (SOTB1). Data can be received when bit 6 (TRMD1) of serial operation mode register 1 (CSIM1) is 0. Reception is started when data is read from serial I/O shift register 1 (SIO1). However, if bit 5 (SSE1) of CSIM1 is set to 1 in slave mode, the operation is as follows. <1> Low level input to the SS1 pin Transmission/reception is started when SOTB1 is written, or reception is started when SIO1 is read. <2> High level input to the SS1 pin Transmission/reception or reception is held, therefore, even if SOTB1 is written or SIO1 is read, transmission/reception or reception will not be started. <3> Data is written to SOTB1 or data is read from SIO1 while a high level is input to the SS1 pin, then a low level is input to the SS1 pin Transmission/reception or reception is started. <4> A high level is input to the SS1 pin during transmission/reception or transmission Transmission/reception or reception is suspended. After communication has been started, bit 0 (CSOT1) of CSIM1 is set to 1. When communication of 8-bit data has been completed, a communication completion interrupt request flag (CSIIF1) is set, and CSOT1 is cleared to 0. Then the next communication is enabled. Cautions 1. Do not access the control register and data register when CSOT1 = 1 (during serial communication). 2. When bit 5 (SSE1) of CSIM1 is set to 1 in slave mode, input a low level to the SS1 pin one clock or more before the clock operation starts.
User's Manual U14260EJ3V1UD
325
CHAPTER 17
SERIAL INTERFACE CSI1
Figure 17-6. Timing of 3-Wire Serial I/O Mode (1/2) (1) Transmission/reception timing (Type 1; TRMD1 = 1, DIR1 = 0, CKP1 = 0, DAP1 = 0, SSE1 = 1Note)
SS1Note
SCK1
Read/write trigger
SOTB1
55H (communication data)
SIO1
ABH
56H
ADH
5AH
B5H
6AH
D5H
AAH
CSOT1
INTCSI1 CSIIF1
SI1 (receives AAH)
SO1
55H is written to SOTB1.
Note The SSE1 flag and SS1 pin are used in the slave mode.
326
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
Figure 17-6. Timing of 3-Wire Serial I/O Mode (2/2) (2) Transmission/reception timing (Type 2; TRMD1 = 1, DIR1 = 0, CKP1 = 0, DAP1 = 1, SSE1 = 1Note)
SS1Note
SCK1
Read/write trigger
SOTB1
55H (communication data)
SIO1
ABH
56H
ADH
5AH
B5H
6AH
D5H
AAH
CSOT1
INTCSI1 CSIIF1
SI1 (inputs AAH)
SO1
55H is written to SOTB1.
Note The SSE1 flag and SS1 pin are used in the slave mode.
User's Manual U14260EJ3V1UD
327
CHAPTER 17
SERIAL INTERFACE CSI1
Figure 17-7. Timing of Clock/Data Phase (a) Type 1; CKP1 = 0, DAP1 = 0
SCK1 SI1 capture SO1 Writing to SOTB1 or reading from SIO1 CSIIF1 CSOT1 D7 D6 D5 D4 D3 D2 D1 D0
(b) Type 2; CKP1 = 0, DAP1 = 1
SCK1 SI1 capture SO1 Writing to SOTB1 or reading from SIO1 CSIIF1 CSOT1 D7 D6 D5 D4 D3 D2 D1 D0
(c) Type 3; CKP1 = 1, DAP1 = 0
SCK1 SI1 capture SO1 Writing to SOTB1 or reading from SIO1 CSIIF1 CSOT1 D7 D6 D5 D4 D3 D2 D1 D0
(d) Type 4; CKP1 = 1, DAP1 = 1
SCK1 SI1 capture SO1 Writing to SOTB1 or reading from SIO1 CSIIF1 CSOT1 D7 D6 D5 D4 D3 D2 D1 D0
328
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
(3) Timing of output to SO1 pin (first bit) When communication is started, the value of transmit buffer register 1 (SOTB1) is output from the SO1 pin. The following describes the output operation of the first bit at this time. Figure 17-8. Output Operation of First Bit (1) CKP1 = 0, DAP1 = 0 (or CKP1 = 1, DAP1 = 0)
SCK1 Writing to SOTB1 or reading from SIO1 SOTB1 SIO1 Output latch SO1 First bit 2nd bit
The first bit is directly latched to the output latch from the SOTB1 register at the falling (or rising) edge of SCK1, passed through the output selector and output from the SO1 pin. The value of the SOTB1 register is transferred to the SIO1 register at the next rising (or falling) edge of SCK1 and the data shifts by one bit. Simultaneously, the first bit of the received data is passed through the SI1 pin and stored in the SIO1 register. The second and subsequent bits are latched to the output latch at the next falling (or rising) edge of SCK1 and the respective data is output from the SO1 pin. (2) CKP1 = 0, DAP1 = 1 (or CKP1 = 1, DAP1 = 1)
SCK1 Writing to SOTB1 or reading from SIO1 SOTB1 SIO1 Output latch SO1 First bit 2nd bit 3rd bit
The first bit is output from the SO1 pin directly from the SOTB1 register through the output selector at the falling edge of the write signal of SOTB1 or the read signal of the SIO1 register. The value of the SOTB1 register is transferred to the SIO1 register at the next falling (or rising) edge of SCK1 and shifts by one bit. Simultaneously, the first bit of the received data is stored in the SIO1 register through the SI1 pin. The second and subsequent bits are latched to the output latch from SIO1 at the next rising (or falling) edge of SCK1 and the data is output from the SO1 pin.
User's Manual U14260EJ3V1UD
329
CHAPTER 17
SERIAL INTERFACE CSI1
(4) Output value of SO1 pin (last bit) After communication has been completed, the SO1 pin holds the output value of the last bit. Figure 17-9. Output Value of SO1 Pin (Last Bit) (1) Type 1; CKP1 = 0 and DAP1 = 0 (or CKP1 = 1, DAP1 = 0)
SCK1 Writing to SOTB1 or reading from SIO1 SOTB1 SIO1 SO1 Output latch Last bit ( Next request is issued.)
(2) Type 2; CKP1 = 0 and DAP1 = 1 (or CKP1 = 1, DAP1 = 1)
SCK1 Writing to SOTB1 or reading from SIO1 SOTB1 SIO1 SO1 Output latch Last bit ( Next request is issued.)
330
User's Manual U14260EJ3V1UD
CHAPTER 17
SERIAL INTERFACE CSI1
(5) SO1 output The status of the SO1 output is as follows if bit 7 (CSIE1) of serial operation mode register 1 (CSIM1) is cleared to 0. Table 17-3. SO1 Output Status
TRMD1 TRMD1 = 0Note 2 TRMD1 = 1 DAP1 - DAP1 = 0 DAP1 = 1 DIR1 = 0 DIR1 = 1 DIR1 - - SO1 OutputNote 1 Low-level outputNote 2 SO1 latch value (low-level output) Bit 7 value of SOTB1 Bit 0 value of SOTB1
Notes 1. The PM21, P21, and SSE1 bits and the SS1 pin must also be set to actually produce an output from the SO1/P21 pin. 2. Status after reset Caution If a value is written to the TRMD1, DAP1, and DIR1 bits, the output value of the SO1 bit changes.
User's Manual U14260EJ3V1UD
331
332
(1) Operation stop mode
CSIM1 CSIE1 0 TRMD1 0 SSE1 x DIR1 x CKP1 1 DAP1 0 CSIC1 CKS12 0 CKS11 0
Table 17-4. Register Settings
PM20 CKS10 0 x
Note
P20
PM21
P21
PM22
P22 P20/SI1
Pin Function P21/SO1 P21 P22/SCK1 P22
Operation Mode Stop
x
Note
x
Note
x
Note
x
Note
x
Note
P20
Other than above
Setting prohibited
(2) 3-wire serial I/O mode
CSIM1 CSIE1 1 1 1 1 1 1
User's Manual U14260EJ3V1UD
CSIC1 DIR1 0/1 0/1 0/1 0/1 0/1 0/1 CKP1 0/1 0/1 0/1 0/1 0/1 0/1 DAP1 0/1 0/1 0/1 0/1 0/1 0/1 Other than above CKS12 1 1 1 CKS11 1 1 1 Other than above CKS10 1 1 1
PM20
P20
PM21
P21
PM22
P22 P20/SI1
Pin Function P21/SO1 P21 SO1 SO1 P21 SO1 SO1 P22/SCK1 SCK1 input
Operation Mode
TRMD1 0 1 1 0 1 1
SSE1 x x x x x x
CHAPTER 17
1 xNote 1 1 x
Note
x xNote x x x
Note
xNote 0 0 xNote 0 0
xNote 0 0 xNote 0 0
1 1 1 0 0 0
x x x 0 0 0
SI1 P20 SI1 SI1 P20 SI1
Slave receive
SCK1 input Slave transmit SCK1 input Slave transmit/receive SCK1 output Master receive SCK1 output Master transmit SCK1 output Master transmit/receive
SERIAL INTERFACE CSI1
1
x
Setting prohibited
Note Can be set as port function. Remark x: Don't care, CSIM1: Serial operation mode register 1, CSIC1: Serial clock select register 1, PMxx: Port mode register, Pxx: Output latch of port
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.1
Functions of Serial Interface IIC0
Serial interface IIC0 has the following two modes. (1) Operation stop mode This mode is used when serial transfers are not performed. It can therefore be used to reduce power consumption. (2) I2C bus mode (multimaster supported) This mode is used for 8-bit data transfers with several devices via two lines: a serial clock (SCL0) line and a serial data bus (SDA0) line. The transfer rate is as follows. * 97.5 kHz (standard mode) or 350 kHz (high-speed mode): When operated at fX = 8.38 MHz This mode complies with the I2C bus format and can output "start condition", "data", and "stop condition" data segments when transmitting via the serial data bus. These data segments are automatically detected by hardware during reception. Since SCL0 and SDA0 are open-drain outputs, the IIC0 requires pull-up resistors for the serial clock line (SCL0) and the serial data bus line (SDA0). Figure 18-1 shows a block diagram of serial interface IIC0.
User's Manual U14260EJ3V1UD
333
334
SDA0/P32
User's Manual U14260EJ3V1UD
Figure 18-1. Block Diagram of Serial Interface IIC0
Internal bus IIC status register 0 (IICS0) MSTS0 ALD0 EXC0 COI0 TRC0 ADKD0 STD0 SPD0 IIC control register 0 (IICC0) Slave address IICE0 LREL0 WREL0 SPIE0 WTIM0 ACKE0 STT0 SPT0 register 0 (SVA0) Match signal CLEAR SET SO0 latch IIC shift DQ register 0 (IIC0) CL00 Data hold time correction circuit Output latch (P32) ACK output circuit Wake-up controller ACK detector Start condition detector Stop condition detector Noise eliminator Serial clock counter Serial clock controller N-ch open -drain output PM33 Output latch (P33) IIC transfer clock select CLD0 DAD0 SMC0 DFC0 CL00 register 0 (IICCL0) fX Prescaler Serial clock wait controller Interrupt request signal generator INTIIC0
CHAPTER 18
Noise eliminator
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
N-ch open -drain output PM32
SCL0/P33
Internal bus
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-2 shows a serial bus configuration example. Figure 18-2. Serial Bus Configuration Example Using I2C Bus
+VDD0 +VDD0
Master CPU1 Slave CPU1 Address 0
SDA0 SCL0
Serial data bus Serial clock
SDA0 SCL0
Master CPU2 Slave CPU2 Address 1
SDA0 SCL0
Slave CPU3 Address 2
SDA0 SCL0
Slave IC Address 3
SDA0 SCL0
Slave IC Address N
User's Manual U14260EJ3V1UD
335
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.2
Configuration of Serial Interface IIC0
Serial interface IIC0 includes the following hardware. Table 18-1. Configuration of Serial Interface IIC0
Item Registers Configuration IIC shift register 0 (IIC0) Slave address register 0 (SVA0) IIC control register 0 (IICC0) IIC status register 0 (IICS0) IIC transfer clock select register 0 (IICCL0) Port mode register 3 (PM3) Port register 3 (P3)
Control registers
(1) IIC shift register 0 (IIC0) IIC0 is used to convert 8-bit serial data to 8-bit parallel data and vice versa in synchronization with the serial clock. IIC0 can be used for both transmission and reception. Write and read operations to IIC0 are used to control the actual transmit and receive operations. IIC0 is set by an 8-bit memory manipulation instruction. RESET input clears IIC0 to 00H. Figure 18-3. Format of IIC Shift Register 0 (IIC0)
Address: FF1FH After reset: 00H Symbol IIC0 7 6 R/W 5 4 3 2 1 0
Caution
Do not write data to IIC0 during data transfer.
(2) Slave address register 0 (SVA0) This register sets local addresses when in slave mode. SVA0 is set by an 8-bit memory manipulation instruction. RESET input clears SVA0 to 00H. Figure 18-4. Format of Slave Address Register 0 (SVA0)
Address: FFABH After reset: 00H Symbol SVA0 7 6 R/W 5 4 3 2 1 0 0
Note
Note Bit 0 is fixed to 0.
336
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(3) SO0 latch The SO0 latch is used to retain the SDA0 pin's output level. (4) Wake-up controller This circuit generates an interrupt request when the address received by this register matches the address value set to slave address register 0 (SVA0) or when an extension code is received. (5) Prescaler This selects the sampling clock to be used. (6) Serial clock counter This counter counts the serial clocks that are output or input during transmit/receive operations and is used to verify that 8-bit data was transmitted or received. (7) Interrupt request signal generator This circuit controls the generation of interrupt request signals (INTIIC0). An I2C interrupt request is generated by the following two triggers. * Falling edge of eighth or ninth clock of the serial clock (set by WTIM0 bitNote) * Interrupt request generated when a stop condition is detected (set by SPIE0 bitNote) Note WTIM0 bit: Bit 3 of IIC control register 0 (IICC0) SPIE0 bit: Bit 4 of IIC control register 0 (IICC0) (8) Serial clock controller In master mode, this circuit generates the clock output via the SCL0 pin from a sampling clock. (9) Serial clock wait controller This circuit controls the wait timing. (10) ACK output circuit, stop condition detector, start condition detector, and ACK detector These circuits are used to output and detect various control signals. (11) Data hold time correction circuit This circuit generates the hold time for data corresponding to the falling edge of the serial clock.
User's Manual U14260EJ3V1UD
337
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.3
Registers to Control Serial Interface IIC0
Serial interface IIC0 is controlled by the following five registers. * IIC control register 0 (IICC0) * IIC status register 0 (IICS0) * IIC transfer clock select register 0 (IICCL0) * Port mode register 3 (PM3) * Port register 3 (P3) (1) IIC control register 0 (IICC0) This register is used to enable/stop I2C operations, set wait timing, and set other I2C operations. IICC0 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears IICC0 to 00H.
338
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-5. Format of IIC Control Register 0 (IICC0) (1/4)
Address: FFA8H After reset: 00H Symbol IICC0 7 IICE0 6 LREL0 R/W 5 WREL0 4 SPIE0 3 WTIM0 2 ACKE0 1 STT0 0 SPT0
IICE0 0 1
I2C operation enable Stop operation. Reset IIC status register 0 (IICS0). Stop internal operation. Enable operation. Condition for setting (IICE0 = 1) * Set by instruction
Condition for clearing (IICE0 = 0) * Cleared by instruction * When RESET is input
LREL0 0 1 Normal operation
Exit from communications
This exits from the current communications operation and sets standby mode. This setting is automatically cleared after being executed. Its uses include cases in which a locally irrelevant extension code has been received. The SCL0 and SDA0 lines go into the high impedance state. The following flags of IIC status register 0 (IICS0) and IIC control register 0 (IICC0) are cleared. * STD0 * ACKD0 * TRC0 * COI0 * EXC0 * MSTS0 * STT0 * SPT0
The standby mode following exit from communications remains in effect until the following communications entry conditions are met. * After a stop condition is detected, restart is in master mode. * An address match or extension code reception occurs after the start condition. Condition for clearing (LREL0 = 0)Note * Automatically cleared after execution * When RESET is input Condition for setting (LREL0 = 1) * Set by instruction
WREL0 0 1 Do not cancel wait.
Cancel wait
Cancel wait. This setting is automatically cleared after wait is canceled.
When WREL0 is set (wait canceled) during the wait period at the ninth clock pulse in the transmission status (TRC0 = 1), the SDA0 line goes into the high impedance state (TRC0 = 0). Condition for clearing (WREL0 = 0)Note * Automatically cleared after execution * When RESET is input Condition for setting (WREL0 = 1) * Set by instruction
SPIE0 0 1 Disable Enable
Enable/disable generation of interrupt request when stop condition is detected
Condition for clearing (SPIE0 = 0)Note * Cleared by instruction * When RESET is input
Condition for setting (SPIE0 = 1) * Set by instruction
Note This flag's signal is invalid when IICE0 = 0.
User's Manual U14260EJ3V1UD
339
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-5. Format of IIC Control Register 0 (IICC0) (2/4)
WTIM0 0 Control of wait and interrupt request generation Interrupt request is generated at the eighth clock's falling edge. Master mode: After output of eight clocks, clock output is set to low level and wait is set. Slave mode: After input of eight clocks, the clock is set to low level and wait is set for master device. Interrupt request is generated at the ninth clock's falling edge. Master mode: After output of nine clocks, clock output is set to low level and wait is set. Slave mode: After input of nine clocks, the clock is set to low level and wait is set for master device.
1
This bit's setting is invalid during an address transfer and is valid after the transfer is completed. When in master mode, a wait is inserted at the falling edge of the ninth clock during address transfers. For a slave device that has received a local address, a wait is inserted at the falling edge of the ninth clock after an ACK signal is issued. When the slave device has received an extension code, a wait is inserted at the falling edge of the eighth clock. Condition for clearing (WTIM0 = 0)Note * Cleared by instruction * When RESET is input Condition for setting (WTIM0 = 1) * Set by instruction
ACKE0 0 1 Disable acknowledgment.
Acknowledgment control
Enable acknowledgment. During the ninth clock period, the SDA0 line is set to low level. However, the ACK is invalid during address transfers and is valid when EXC0 = 1.
Condition for clearing (ACKE0 = 0)Note * Cleared by instruction * When RESET is input
Condition for setting (ACKE0 = 1) * Set by instruction
Note This flag's signal is invalid when IICE0 = 0.
340
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-5. Format of IIC Control Register 0 (IICC0) (3/4)
STT0 0 1 Do not generate a start condition. When bus is released (during STOP mode): Generate a start condition (for starting as master). The SDA0 line is changed from high level to low level and then the start condition is generated. Next, after the rated amount of time has elapsed, SCL0 is changed to low level. When bus is not used: This trigger functions as a start condition reservation flag. When set, it releases the bus and then automatically generates a start condition. Wait status (during master mode): Generate a restart condition after wait is released. Start condition trigger
Cautions concerning set timing * For master reception: Cannot be set during transfer. Can be set only in the waiting period when ACKE0 has been set to 0 and slave has been notified of final reception. * For master transmission: A start condition may not be generated normally during the ACK period. Therefore, set it during the waiting period. * Cannot be set at the same time as SPT0. Condition for clearing (STT0 = 0) * Cleared by loss in arbitration * Cleared after start condition is generated by master device * Cleared by LREL0 = 1 (exit from communications) * When IICE0 = 0 (operation stop) * When RESET is input Condition for setting (STT0 = 1) * Set by instruction
Remark Bit 1 (STT0) is 0 when read after data has been set.
User's Manual U14260EJ3V1UD
341
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-5. Format of IIC Control Register 0 (IICC0) (4/4)
SPT0 0 1 Stop condition is not generated. Stop condition is generated (termination of master device's transfer). After the SDA0 line goes to low level, either set the SCL0 line to high level or wait until it goes to high level. Next, after the rated amount of time has elapsed, the SDA0 line changes from low level to high level and a stop condition is generated. Stop condition trigger
Cautions concerning set timing * For master reception: Cannot be set during transfer. Can be set only in the waiting period when ACKE0 has been set to 0 and slave has been notified of final reception. * For master transmission: A stop condition cannot be generated normally during the ACK0 period. Therefore, set it during the waiting period. * Cannot be set at the same time as STT0. * SPT0 can be set only when in master mode.Note * When WTIM0 has been set to 0, if SPT0 is set during the wait period that follows output of eight clocks, note that a stop condition will be generated during the high level period of the ninth clock. When a ninth clock must be output, WTIM0 should be changed from 0 to 1 during the wait period following output of eight clocks, and SPT0 should be set during the wait period that follows output of the ninth clock. Condition for clearing (SPT0 = 0) * Cleared by loss in arbitration * Automatically cleared after stop condition is detected * Cleared by LREL0 = 1 (exit from communications) * When IICE0 = 0 (operation stop) * When RESET is input Condition for setting (SPT0 = 1) * Set by instruction
Note Set SPT0 only in master mode. However, SPT0 must be set and a stop condition generated before the first stop condition is detected following the switch to the operation enabled status. For details, see 18.5.14 Other cautions. Caution When bit 3 (TRC0) of IIC status register 0 (IICS0) is set to 1, WREL0 is set during the ninth clock and wait is canceled, after which TRC0 is cleared and the SDA0 line is set to high impedance. Remark Bit 0 (SPT0) becomes 0 when it is read after data setting.
342
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(2) IIC status register 0 (IICS0) This register indicates the status of I2C. IICS0 is read by a 1-bit or 8-bit memory manipulation instruction. RESET input clears IICS0 to 00H. Figure 18-6. Format of IIC Status Register 0 (IICS0) (1/3)
Address: FFA9H After reset: 00H Symbol IICS0 7 MSTS0 6 ALD0 R 5 EXC0 4 COI0 3 TRC0 2 ACKD0 1 STD0 0 SPD0
MSTS0 0 1
Master device status Slave device status or communication standby status Master device communication status Condition for setting (MSTS0 = 1) * When a start condition is generated
Condition for clearing (MSTS0 = 0) * * * * * When a stop condition is detected When ALD0 = 1 (arbitration loss) Cleared by LREL0 = 1 (exit from communications) When IICE0 changes from 1 to 0 (operation stop) When RESET is input
ALD0 0 1
Detection of arbitration loss This status means either that there was no arbitration or that the arbitration result was a "win". This status indicates the arbitration result was a "loss". MSTS0 is cleared. Condition for setting (ALD0 = 1) readNote * When the arbitration result is a "loss".
Condition for clearing (ALD0 = 0) * Automatically cleared after IICS0 is * When IICE0 changes from 1 to 0 (operation stop) * When RESET is input
EXC0 0 1
Detection of extension code reception Extension code was not received. Extension code was received. Condition for setting (EXC0 = 1) * When the higher 4 bits of the received address data are either "0000" or "1111" (set at the rising edge of the eighth clock).
Condition for clearing (EXC0 = 0) * * * * * When a start condition is detected When a stop condition is detected Cleared by LREL0 = 1 (exit from communications) When IICE0 changes from 1 to 0 (operation stop) When RESET is input
Note This register is also cleared when a bit manipulation instruction is executed for bits other than IICS0. Remark LREL0: Bit 6 of IIC control register 0 (IICC0) IICE0: Bit 7 of IIC control register 0 (IICC0)
User's Manual U14260EJ3V1UD
343
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-6. Format of IIC Status Register 0 (IICS0) (2/3)
COI0 0 1 Addresses do not match. Addresses match. Condition for setting (COI0 = 1) * When the received address matches the local address (slave address register 0 (SVA0)) (set at the rising edge of the eighth clock). Detection of matching addresses
Condition for clearing (COI0 = 0) * * * * * When a start condition is detected When a stop condition is detected Cleared by LREL0 = 1 (exit from communications) When IICE0 changes from 1 to 0 (operation stop) When RESET is input
TRC0 0 1
Detection of transmit/receive status Receive status (other than transmit status). The SDA0 line is set to high impedance. Transmit status. The value in the SO0 latch is enabled for output to the SDA0 line (valid starting at the falling edge of the first byte's ninth clock).
Condition for clearing (TRC0 = 0) * When a stop condition is detected * Cleared by LREL0 = 1 (exit from communications) * When IICE0 changes from 1 to 0 (operation stop) * Cleared by WREL0 = 1Note (wait cancel) * When ALD0 changes from 0 to 1 (arbitration loss) * When RESET is input * When "1" is output to the first byte's LSB (transfer direction specification bit) * When a start condition is detected * When "0" is input to the first byte's LSB (transfer direction specification bit)
Condition for setting (TRC0 = 1) Master * When a start condition is generated * When "0" is output to the first byte's LSB (transfer direction specification bit) Slave * When "1" is input to the first byte's LSB (transfer direction specification bit)
Note If the wait status is canceled by setting bit 5 (WREL0) of IIC control register 0 (IICC0) to 1 at the ninth clock when bit 3 (TRC0) of IIC status register 0 (IICS0) is 1, TRC0 is cleared, and the SDA0 line goes into a high-impedance state. Remark LREL0: Bit 6 of IIC control register 0 (IICC0) IICE0: Bit 7 of IIC control register 0 (IICC0)
344
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-6. Format of IIC Status Register 0 (IICS0) (3/3)
ACKD0 0 1 ACK was not detected. ACK was detected. Condition for setting (ACKD0 = 1) * After the SDA0 line is set to low level at the rising edge of the SCL0's ninth clock Detection of ACK
Condition for clearing (ACKD0 = 0) * * * * * When a stop condition is detected At the rising edge of the next byte's first clock Cleared by LREL0 = 1 (exit from communications) When IICE0 changes from 1 to 0 (operation stop) When RESET is input
STD0 0 1 Start condition was not detected.
Detection of start condition
Start condition was detected. This indicates that the address transfer period is in effect. Condition for setting (STD0 = 1) * When a start condition is detected
Condition for clearing (STD0 = 0) * When a stop condition is detected * At the rising edge of the next byte's first clock following address transfer * Cleared by LREL0 = 1 (exit from communications) * When IICE0 changes from 1 to 0 (operation stop) * When RESET is input
SPD0 0 1 Stop condition was not detected.
Detection of stop condition
Stop condition was detected. The master device's communication was terminated and the bus was released. Condition for setting (SPD0 = 1) * When a stop condition is detected
Condition for clearing (SPD0 = 0) * At the rising edge of the address transfer byte's first clock following setting of this bit and detection of a start condition * When IICE0 changes from 1 to 0 (operation stop) * When RESET is input
Remark LREL0: Bit 6 of IIC control register 0 (IICC0) IICE0: Bit 7 of IIC control register 0 (IICC0)
User's Manual U14260EJ3V1UD
345
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(3) IIC transfer clock select register 0 (IICCL0) This register is used to set the transfer clock for the I2C bus. IICCL0 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears IICCL0 to 00H. Figure 18-7. Format of IIC Transfer Clock Select Register 0 (IICCL0) (1/2)
Address: FFAAH After reset: 00H Symbol IICCL0 7 0 6 0 R/WNote 5 CLD0 4 DAD0 3 SMC0 2 DFC0 1 0 0 CL00
CLD0 0 1
Detection of SCL0 line level (valid only when IICE0 = 1) SCL0 line was detected at low level. SCL0 line was detected at high level. Condition for setting (CLD0 = 1) * When the SCL0 line is at high level
Condition for clearing (CLD0 = 0) * When the SCL0 line is at low level * When IICE0 = 0 (operation stop) * When RESET is input
DAD0 0 1
Detection of SDA0 line level (valid only when IICE0 = 1) SDA0 line was detected at low level. SDA0 line was detected at high level. Condition for setting (DAD0 = 1) * When the SDA0 line is at high level
Condition for clearing (DAD0 = 0) * When the SDA0 line is at low level * When IICE0 = 0 (operation stop) * When RESET is input
SMC0 0 1 Operation in standard mode Operation in high-speed mode
Operation mode switching
Condition for clearing (SMC0 = 0) * Cleared by instruction * When RESET is input
Condition for setting (SMC0 = 1) * Set by instruction
Note Bits 4 and 5 are read-only bits. Remark IICE0: Bit 7 of IIC control register 0 (IICC0)
346
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-7. Format of IIC Transfer Clock Select Register 0 (IICCL0) (2/2)
DFC0 0 1 Digital filter off Digital filter on Control of digital filter operationNote 1
CL00 Standard mode
Selection of transfer rate High-speed mode fX = 8.38 MHz fX/24 350 kHz
fX = 8.38 MHz 0 1 fX/44 fX/86 190.4 kHzNote 2
97.5 kHz
Notes 1. The digital filter can be used when in high-speed mode. The response time is slower when the digital filter is used. 2. The transfer rate in standard mode must not be set when fX is more than 100 kHz. Caution Stop serial transfer once before rewriting CL00 to other than the same value.
Remarks 1. fX: Main system clock oscillation frequency 2. The transfer clock does not change in the high-speed mode even if DFC0 is turned on and off. (4) Port mode register 3 (PM3) PM3 is a register that set the input/output of port 3 in 1-bit units. To use the P32/SDA0 pin as serial data I/O and the P33/SCL0 pin as clock I/O, set PM32 and PM33, and the output latches of P32 and P33 to 0. PM3 is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets PM3 to FFH. Figure 18-8. Format of Port Mode Register 3 (PM3)
Address: FF23H After reset: FFH Symbol PM3 7 1 6 PM36 R/W 5 PM35 4 PM34 3 PM33 2 PM32 1 PM31 0 PM30
PM3n 0 1
I/O mode selection of P3n pin (n = 0 to 6) Output mode (output buffer on) Input mode (output buffer off)
User's Manual U14260EJ3V1UD
347
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.4
I2C Bus Mode Functions
18.4.1 Pin configuration The serial clock pin (SCL0) and serial data bus pin (SDA0) are configured as follows. (1) SCL0 ********* This pin is used for serial clock input and output. This pin is an N-ch open-drain output for both master and slave devices. Input is Schmitt input. (2) SDA0 ********* This pin is used for serial data input and output. This pin is an N-ch open-drain output for both master and slave devices. Input is Schmitt input. Since outputs from the serial clock line and the serial data bus line are N-ch open-drain outputs, an external pullup resistor is required. Figure 18-9. Pin Configuration Diagram
VDD0 Slave device
Master device SCL0 Clock output VSS0 (Clock input) SDA0 Data output VSS0 Data input VSS0 Data input SDA0 Data output VDD0 VSS0 Clock input SCL0 (Clock output)
348
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5
I2C Bus Definitions and Control Methods
The following section describes the I2C bus's serial data communication format and the signals used by the I2C bus. Figure 18-10 shows the transfer timing for the "start condition", "data", and "stop condition" output via the I2C bus's serial data bus. Figure 18-10. I2C Bus Serial Data Transfer Timing
SCL0
1-7
8
9
1-7
8
9
1-7
8
9
SDA0 Start Address condition R/W ACK Data ACK Data ACK Stop condition
The master device outputs the start condition, slave address, and stop condition. The acknowledge signal (ACK) can be output by either the master or slave device (normally, it is output by the device that receives 8-bit data). The serial clock (SCL0) is continuously output by the master device. However, in the slave device, the SCL0's low level period can be extended and a wait can be inserted. 18.5.1 Start conditions A start condition is met when the SCL0 pin is at high level and the SDA0 pin changes from high level to low level. The start conditions for the SCL0 pin and SDA0 pin are signals that the master device outputs to the slave device when starting a serial transfer. When the device is used as a slave, start conditions can be detected. Figure 18-11. Start Conditions
H SCL0
SDA0
A start condition is output when bit 1 (STT0) of IIC control register 0 (IICC0) is set (to 1) after a stop condition has been detected (SPD0: Bit 0 = 1 in IIC status register 0 (IICS0)). When a start condition is detected, bit 1 (STD0) of IICS0 is set (to 1).
User's Manual U14260EJ3V1UD
349
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.2 Addresses The address is defined by the 7 bits of data that follow the start condition. An address is a 7-bit data segment that is output in order to select one of the slave devices that are connected to the master device via the bus lines. Therefore, each slave device connected via the bus lines must have a unique address. The slave devices include hardware that detects the start condition and checks whether or not the 7-bit address data matches the data values stored in slave address register 0 (SVA0). If the address data matches the SVA0 values, the slave device is selected and communicates with the master device until the master device transmits a start condition or stop condition. Figure 18-12. Address
SCL0 1 2 3 4 5 6 7 8 9
SDA0
A6
A5
A4
A3 Address
A2
A1
A0
R/W
Note
INTIIC0
Note INTIIC0 is not issued if data other than a local address or extension code is received during slave device operation. The slave address and the eighth bit, which specifies the transfer direction as described in 18.5.3 Transfer direction specification below, are together written to IIC shift register 0 (IIC0) and are then output. Received addresses are written to IIC0. The slave address is assigned to the higher 7 bits of IIC0. 18.5.3 Transfer direction specification In addition to the 7-bit address data, the master device sends 1 bit that specifies the transfer direction. When this transfer direction specification bit has a value of "0", it indicates that the master device is transmitting data to a slave device. When the transfer direction specification bit has a value of "1", it indicates that the master device is receiving data from a slave device. Figure 18-13. Transfer Direction Specification
SCL0
1
2
3
4
5
6
7
8
9
SDA0
A6
A5
A4
A3
A2
A1
A0
R/W
Transfer direction specification Note INTIIC0
Note INTIIC0 is not issued if data other than a local address or extension code is received during slave device operation.
350
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.4 Acknowledge (ACK) signal The acknowledge (ACK) signal is used by the transmitting and receiving devices to confirm serial data reception. The receiving device returns one ACK signal for each 8 bits of data it receives. The transmitting device normally receives an ACK signal after transmitting 8 bits of data. However, when the master device is the receiving device, it does not output an ACK signal after receiving the final data to be transmitted. The transmitting device detects whether or not an ACK signal is returned after it transmits 8 bits of data. When an ACK signal is returned, the reception is judged as normal and processing continues. If the slave device does not return an ACK signal, the master device outputs either a stop condition or a restart condition and then stops the current transmission. Failure to return an ACK signal may be caused by the following two factors. (a) Reception was not performed normally. (b) The final data was received. When the receiving device sets the SDA0 line to low level during the ninth clock, the ACK signal becomes active (normal receive response). When bit 2 (ACKE0) of IIC control register 0 (IICC0) is set to 1, automatic ACK signal generation is enabled. Transmission of the eighth bit following the 7 address data bits causes bit 3 (TRC0) of IIC status register 0 (IICS0) to be set. When this TRC0 bit's value is "0", it indicates receive mode. Therefore, ACKE0 should be set to 1. When the slave device is receiving (when TRC0 = 0), if the slave devices does not need to receive any more data after receiving several bytes, setting ACKE0 to 0 will prevent the master device from starting transmission of the subsequent data. Similarly, when the master device is receiving (when TRC0 = 0) and the subsequent data is not needed and when either a restart condition or a stop condition should therefore be output, setting ACKE0 to 0 will prevent the ACK signal from being returned. This prevents the MSB data from being output via the SDA0 line (i.e., stops transmission) during transmission from the slave device. Figure 18-14. ACK Signal
SCL0 1 2 3 4 5 6 7 8 9
SDA0
A6
A5
A4
A3
A2
A1
A0
R/W ACK
When the local address is received, an ACK signal is automatically output in sync with the falling edge of the SCL0's eighth clock regardless of the ACKE0 value. No ACK signal is output if the received address is not a local address. The ACK signal output method during data reception is based on the wait timing setting, as described below. * When 8-clock wait is selected: ACK signal is output when ACKE0 is set to 1 before wait cancellation. (WTIM0 = 0) * When 9-clock wait is selected: ACK signal is automatically output at the falling edge of the SCL0's eighth clock (WTIM0 = 1) if ACKE0 has already been set to 1.
User's Manual U14260EJ3V1UD
351
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.5 Stop condition When the SCL0 pin is at high level, changing the SDA0 pin from low level to high level generates a stop condition. A stop condition is a signal that the master device outputs to the slave device when serial transfer has been completed. When the device is used as a slave, stop conditions can be detected. Figure 18-15. Stop Condition
H SCL0
SDA0
A stop condition is generated when bit 0 (SPT0) of IIC control register 0 (IICC0) is set (to 1). When the stop condition is detected, bit 0 (SPD0) of IIC status register 0 (IICS0) is set (to 1) and INTIIC0 is generated when bit 4 (SPIE0) of IICC0 is set (to 1).
352
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.6 Wait signal (WAIT) The wait signal (WAIT) is used to notify the communication partner that a device (master or slave) is preparing to transmit or receive data (i.e., is in a wait state). Setting the SCL0 pin to low level notifies the communication partner of the wait status. When wait status has been canceled for both the master and slave devices, the next data transfer can begin. Figure 18-16. Wait Signal (1/2) (1) When master device has a nine-clock wait and slave device has an eight-clock wait (master transmits, slave receives, and ACKE0 = 1)
Master Master returns to high Wait after output impedance but slave is in wait state (low level). of ninth clock IIC0 data write (cancel wait)
IIC0
SCL0
6
7
8
9
1
2
3
Slave Wait after output of eighth clock FFH is written to IIC0 or WREL0 is set to 1 IIC0 SCL0
ACKE0
H
Transfer lines
Wait signal from slave 6 7 8 9
Wait signal from master 1 2 3
SCL0
SDA0
D2
D1
D0
ACK
D7
D6
D5
User's Manual U14260EJ3V1UD
353
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-16. Wait Signal (2/2) (2) When master and slave devices both have a nine-clock wait (master transmits, slave receives, and ACKE0 = 1)
Master IIC0
Master and slave both wait after output of ninth clock IIC0 data write (cancel wait)
SCL0 Slave IIC0 SCL0
6
7
8
9
1
2
3
FFH is written to IIC0 or WREL0 is set to 1
ACKE0 Transfer lines SCL0
H Wait signal from master and slave 6 7 8 9 Wait signal from slave 1 2 3
SDA0
D2
D1
D0
ACK
D7
D6
D5
Output according to previously set ACKE0 value
Remark
ACKE0: Bit 2 of IIC control register 0 (IICC0) WREL0: Bit 5 of IIC control register 0 (IICC0)
A wait may be automatically generated depending on the setting of bit 3 (WTIM0) of IIC control register 0 (IICC0). Normally, the receiving side cancels the wait status when bit 5 (WREL0) of IICC0 is set to 1 or when FFH is written to IIC shift register 0 (IIC0), and the transmitting side cancels the wait status when data is written to IIC0. The master device can also cancel the wait status via either of the following methods. * By setting bit 1 (STT0) of IICC0 to 1 * By setting bit 0 (SPT0) of IICC0 to 1
354
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.7 Interrupt request (INTIIC0) generation timing and wait control The setting of bit 3 (WTIM0) of IIC control register 0 (IICC0) determines the timing by which INTIIC0 is generated and the corresponding wait control, as shown in Table 18-2. Table 18-2. INTIIC0 Generation Timing and Wait Control
During Slave Device Operation WTIM0 0 1 Address 9Notes 1, 2 9Notes 1, 2 Data Reception 8Note 2 9Note 2 Data Transmission 8Note 2 9Note 2 During Master Device Operation Address 9 9 Data Reception 8 9 Data Transmission 8 9
Notes 1. The slave device's INTIIC0 signal and wait period occurs at the falling edge of the ninth clock only when there is a match with the address set to slave address register 0 (SVA0). At this point, ACK is output regardless of the value set to IICC0's bit 2 (ACKE0). For a slave device that has received an extension code, INTIIC0 occurs at the falling edge of the eighth clock. However, if the address does not match after restart, INTIIC0 is generated at the falling edge of the 9th clock, but wait does not occur. 2. If the received address does not match the contents of slave address register 0 (SVA0) and extension code is not received, neither INTIIC0 nor a wait occurs. Remark The numbers in the table indicate the number of the serial clock's clock signals. Interrupt requests and wait control are both synchronized with the falling edge of these clock signals. (1) During address transmission/reception * Slave device operation: Interrupt and wait timing are determined depending on the conditions described in Notes 1 and 2 above, regardless of the WTIM0 bit. * Master device operation: Interrupt and wait timing occur at the falling edge of the ninth clock regardless of the WTIM0 bit. (2) During data reception * Master/slave device operation: Interrupt and wait timing are determined according to the WTIM0 bit. (3) During data transmission * Master/slave device operation: Interrupt and wait timing are determined according to the WTIM0 bit. (4) Wait cancellation method The four wait cancellation methods are as follows. * By setting bit 5 (WREL0) of IIC control register 0 (IICC0) to 1 * By writing to IIC shift register 0 (IIC0) * By setting a start condition (setting bit 1 (STT0) of IICC0 to 1)Note * By setting a stop condition (setting bit 0 (SPT0) of IICC0 to 1)Note Note Master only. When an 8-clock wait has been selected (WTIM0 = 0), the output level of ACK must be determined prior to wait cancellation.
User's Manual U14260EJ3V1UD
355
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(5) Stop condition detection INTIIC0 is generated when a stop condition is detected (only when SPIE0 = 1). 18.5.8 Address match detection method In I2C bus mode, the master device can select a particular slave device by transmitting the corresponding slave address. Address match can be detected automatically by hardware. An interrupt request (INTIIC0) occurs when a local address has been set to slave address register 0 (SVA0) and when the address set to SVA0 matches the slave address sent by the master device, or when an extension code has been received. 18.5.9 Error detection In I2C bus mode, the status of the serial data bus (SDA0) during data transmission is captured by IIC shift register 0 (IIC0) of the transmitting device, so the IIC0 data prior to transmission can be compared with the transmitted IIC0 data to enable detection of transmission errors. A transmission error is judged as having occurred when the compared data values do not match. 18.5.10 Extension code (1) When the higher 4 bits of the receive address are either "0000" or "1111", the extension code reception flag (EXC0) is set for extension code reception and an interrupt request (INTIIC0) is issued at the falling edge of the eighth clock. The local address stored in slave address register 0 (SVA0) is not affected. (2) If "111110xx" is set to SVA0 by a 10-bit address transfer and "111110xx" is transferred from the master device, the results are as follows. Note that INTIIC0 occurs at the falling edge of the eighth clock. * Higher four bits of data match: EXC0 = 1Note * Seven bits of data match: COI0 = 1Note
Note EXC0: Bit 5 of IIC status register 0 (IICS0) COI0: Bit 4 of IIC status register 0 (IICS0) (3) Since the processing after the interrupt request occurs differs according to the data that follows the extension code, such processing is performed by software. For example, after the extension code is received, if you do not wish to operate the target device as a slave device, you can set bit 6 (LREL0) of IIC control register 0 (IICC0) to 1 to set the standby mode for the next communication operation. Table 18-3. Extension Code Bit Definitions
Slave Address 0000 0000 0000 0000 1111 000 000 001 010 0xx R/W Bit 0 1 x x x Description General call address Start byte CBUS address Address that is reserved for different bus format 10-bit slave address specification
356
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.11 Arbitration When several master devices simultaneously output a start condition (when STT0 is set to 1 before STD0 is set to 1Note), communication among the master devices is performed as the number of clocks are adjusted until the data differs. This kind of operation is called arbitration. When one of the master devices loses in arbitration, an arbitration loss flag (ALD0) in IIC status register 0 (IICS0) is set (1) via the timing by which the arbitration loss occurred, and the SCL0 and SDA0 lines are both set to high impedance, which releases the bus. The arbitration loss is detected based on the timing of the next interrupt request (the eighth or ninth clock, when a stop condition is detected, etc.) and the ALD0 = 1 setting that has been made by software. For details of interrupt request timing, see 18.5.16 Timing of I2C interrupt request (INTIIC0) occurrence. Note STD0: Bit 1 of IIC status register 0 (IICS0) STT0: Bit 1 of IIC control register 0 (IICC0) Figure 18-17. Arbitration Timing Example
Master 1 SCL0 Hi-Z
SDA0 Master 2 SCL0
Hi-Z Master 1 loses arbitration
SDA0 Transfer lines SCL0
SDA0
User's Manual U14260EJ3V1UD
357
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Table 18-4. Status During Arbitration and Interrupt Request Generation Timing
Status During Arbitration During address transmission Read/write data after address transmission During extension code transmission Read/write data after extension code transmission During data transmission During ACK signal transfer period after data transmission When restart condition is detected during data transfer When stop condition is detected during data transfer When data is at low level while attempting to output a restart condition When stop condition is detected while attempting to output a restart condition When data is at low level while attempting to output a stop condition When SCL0 is at low level while attempting to output a restart condition When stop condition is output (when SPIE0 = 1)Note 2 At falling edge of eighth or ninth clock following byte transferNote 1 When stop condition is output (when SPIE0 = 1)Note 2 At falling edge of eighth or ninth clock following byte transferNote 1 Interrupt Request Generation Timing At falling edge of eighth or ninth clock following byte transferNote 1
Notes 1. When WTIM0 (bit 3 of IIC control register 0 (IICC0)) = 1, an interrupt request occurs at the falling edge of the ninth clock. When WTIM0 = 0 and the extension code's slave address is received, an interrupt request occurs at the falling edge of the eighth clock. 2. When there is a chance that arbitration will occur, set SPIE0 = 1 for master device operation. Remark SPIE0: Bit 4 of IIC control register 0 (IICC0) 18.5.12 Wake-up function The I2C bus slave function is a function that generates an interrupt request (INTIIC0) when a local address and extension code have been received. This function makes processing more efficient by preventing unnecessary interrupt requests from occurring when addresses do not match. When a start condition is detected, wake-up standby mode is set. This wake-up standby mode is in effect while addresses are transmitted due to the possibility that an arbitration loss may change the master device (which has output a start condition) to a slave device. However, when a stop condition is detected, bit 4 (SPIE0) of IIC control register 0 (IICC0) is set regardless of the wake-up function, and this determines whether interrupt requests are enabled or disabled.
358
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.13
Communication reservation
To start master device communications when not currently using a bus, a communication reservation can be made to enable transmission of a start condition when the bus is released. There are two modes under which the bus is not used. * When arbitration results in neither master nor slave operation * When an extension code is received and slave operation is disabled (ACK is not returned and the bus was released when bit 6 (LREL0) of IIC control register 0 (IICC0) was set to 1). If bit 1 (STT0) of IICC0 is set (1) while the bus is not used (after a stop condition is detected), a start condition is automatically generated and wait status is set. When the bus release is detected (when a stop condition is detected), writing to IIC shift register 0 (IIC0) causes the master address transfer to start. At this point, bit 4 (SPIE0) of IICC0 should be set (1). When STT0 has been set (1), the operation mode (as start condition or as communication reservation) is determined according to the bus status. * If the bus has been released ........................................... a start condition is generated * If the bus has not been released (standby mode) .......... communication reservation Check whether the communication reservation operates or not by using MSTS0 (bit 7 of IIC status register 0 (IICS0)) after SST0 is set and the wait time elapses. The wait periods, which should be set via software, are listed in Table 18-5. These wait periods can be set via the settings for bits 3 and 0 (SMC0 and CL00) in IIC transfer clock select register 0 (IICCL0). Table 18-5. Wait Periods
SMC0 0 0 1 1 CL00 0 1 0 1 Wait Period 26 clocks 46 clocks 16 clocks
Figure 18-18 shows the communication reservation timing.
User's Manual U14260EJ3V1UD
359
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-18. Communication Reservation Timing
Program processing
STT0 = 1
Write to IIC0
Hardware processing
Communication reservation
Set SPD0 and INTIIC0
Set STD0
SCL0
1
2
3
4
5
6
7
8
9
1
2
3
4
5
6
SDA0
Output by master with bus mastership
Remark IIC0:
IIC shift register 0
STT0: Bit 1 of IIC control register 0 (IICC0) STD0: Bit 1 of IIC status register 0 (IICS0) SPD0: Bit 0 of IIC status register 0 (IICS0) Communication reservations are accepted via the following timing. After bit 1 (STD0) of IIC status register 0 (IICS0) is set to 1, a communication reservation can be made by setting bit 1 (STT0) of IIC control register 0 (IICC0) to 1 before a stop condition is detected. Figure 18-19. Timing for Accepting Communication Reservations
SCL0
SDA0
STD0
SPD0
Standby mode
Figure 18-20 shows the communication reservation protocol.
360
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-20. Communication Reservation Protocol
DI
SET1 STT0
Sets STT0 flag (communication reservation)
Define communication reservation
Defines that communication reservation is in effect (defines and sets user flag to any part of RAM)
Wait
Secures wait period set by software (see Table 18-5).
(Communication reservation)
Note
Yes
MSTS0 = 0?
Confirmation of communication reservation
No (Generate start condition) Cancel communication reservation Clear user flag
MOV IIC0, #xxH
IIC0 write operation
EI
Note The communication reservation operation executes a write to IIC shift register 0 (IIC0) when a stop condition interrupt request occurs. Remark STT0: IIC0: Bit 1 of IIC control register 0 (IICC0) IIC shift register 0
MSTS0: Bit 7 of IIC status register 0 (IICS0)
18.5.14 Other cautions After a reset, when changing from a mode in which no stop condition has been detected (the bus has not been released) to a master device communication mode, first generate a stop condition to release the bus, then perform master device communication. When using multiple masters, it is not possible to perform master device communication when the bus has not been released (when a stop condition has not been detected). Use the following sequence for generating a stop condition. (a) Set IIC transfer clock select register 0 (IICCL0). (b) Set (1) bit 7 (IICE0) of IIC control register 0 (IICC0). (c) Set (1) bit 0 (SPT0) of IICC0.
User's Manual U14260EJ3V1UD
361
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.15 Communication operations (1) Master operations The procedure of controlling slave EEPROMTM using the PD780078Y Subseries as the master of the I2C bus is as follows. Figure 18-21. Master Operation Flowchart (1/5)
START
First perform initialization to use I2C.
Set port (mode and data). PM32, PM33 1, P32, P33 0
Set the port that functions alternately as the pins to be used. First set the port in the input mode, and clear the output latch to 0.
Set transfer clock. IICCL0 xxH
Specify the operation mode, turn on/off the digital filter, and specify the transfer rate.
Set IIC control register 0. IICE0 = WTIM0 = 1
Set a 9-clock wait and enable operation.
Set port. PM32, PM33 0
Set the port in the output mode to enable output of I2C.
Set interrupt. IICIF0, IICMK0 0
Clear the interrupt request of I2C. Clear the mask to enable the interrupt when using the interrupt.
Issue stop condition. SPT0 = 1
Issue the stop condition before starting operation, and release the bus.
SPD0 = 1? Yes Issue start condition. STT0 = 1
No
Wait until the bus is released. If the stop condition is detected, the bus is released and can be used. Declare use of the bus by issuing the start condition. If the stop condition cannot be detected, the chances are the connected pin is driving the bus low. In this case, refer to Remark.
A
362
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-21. Master Operation Flowchart (2/5)
A
STD0 = 1? Yes Transfer slave address. IIC0 address, R/W (0)
No
Wait until the start condition is detected and the bus is ready.
Specify writing and transfer the address of the slave (EEPROM).
INTIIC0 = 1? Yes Clear INTIIC0.
No Wait until transfer is completed.
Clear INTIIC0 to poll INTIIC0 without using an interrupt. No If ACK is not sent, it means that the specified slave does not exist. End processing.
ACKD0 = 1? Yes
End (no slave) If a slave does exist, divide the address of EEPROM (2 bytes) into two, and start transmitting the address from the higher byte. Each time transmission is completed, check ACK. No
Transmit EEPROM higher address. IIC0 EEPROM higher address
INTIIC0 = 1? Yes Clear INTIIC0.
ACKD0 = 1? Yes
No
End (no acknowledgment)
Transmit EEPROM lower address. IIC0 EEPROM lower address
Transmit the lower address.
B
User's Manual U14260EJ3V1UD
363
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-21. Master Operation Flowchart (3/5)
B
INTIIC0 = 1? Yes Clear INTIIC0.
ACKD0 = 1? Yes
No
End (no acknowledgment) When writing data to EEPROM, continue writing data. When reading data from EEPROM, start reception processing. Prepare data to be written to EEPROM, and transmit it to EEPROM. Each time data has been transmitted, the slave returns ACK. If any error occurs before transmission of the necessary data is completed, ACK may not be returned. In this case, end transfer. In the case of an error, set the error flag as shown on the left, and release the bus.
Transmission? Yes
No
Reception TRC0 = 1? Prepare write data.
Transmit write data. IIC0 Data
INTIIC0 = 1? Yes Clear INTIIC0.
No
End ACKD0 = 1? Yes No Transfer end? Yes C Set error flag. No
364
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-21. Master Operation Flowchart (4/5)
C
When transmission is completed, issue the stop condition to notify the slave of completion of transmission.
Issue stop condition. SPT0 = 1
SPD0 = 1? Yes END
No
Reception
For reception, the data transfer direction must be changed. Issue the start condition again and redo (restart) communication.
Issue start condition. STT0 = 1
STD0 = 1? Yes Transfer slave address. IIC0 address, R/W (1)
No
Because the master receives data this time, set the R/W bit to 1 and transmit an address. No
INTIIC0 = 1? Yes Clear INTIIC0.
ACKD0 = 1? Yes D
No
End (no acknowledgment)
User's Manual U14260EJ3V1UD
365
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-21. Master Operation Flowchart (5/5)
D
Re-set IIC control register 0. ACKE0 = 1, WTIM0 = 0
Set so that ACK is automatically returned after an 8-clock wait (set ACKE0 so that ACK is returned except when the last data is received. Specify an 8-clock wait so that automatic returning of ACK can be cleared when the last data is received).
Start data reception. IIC0 0FFH
Write dummy data to IIC0 and start reception (reception can also be started when WREL0 = 1).
INTIIC0 = 1? Yes Clear INTIIC0.
No Reception is completed when INTIIC0 occurs.
Save receive data.
Save the received data to a buffer.
Yes
Remaining data? No Re-set IIC control register 0. ACKE0 = 0, WREL0 = WTIM0 = 1 When reception of data is completed, disable automatic returning of ACK, set a 9clock wait, cancel wait in the ACK cycle, and stop at the 9th clock. As a result, ACK is not returned to the slave. This indicates the completion of reception. Issue the stop condition and end communication.
INTIIC0 = 1? Yes Issue stop condition. SPT0 = 1
No
SPD0 = 1? Yes END
No
Remark While the slave is outputting a low level to the data line, the master cannot issue the stop condition. This happens if EEPROM is not reset, even though the microcontroller is reset, because of supply voltage fluctuation during communication (reading from EEPROM). In this case, the EEPROM continues sending data, and may output a low level to the data line. Because the structure of I2C does not allow the master to forcibly make the data line high, the master cannot issue the stop condition. To avoid this phenomenon, it is possible to use a clock line as a port, output a dummy clock from the port, continue reading data from EEPROM by inputting the dummy clock, and complete reading with some EEPROMs (because the data line goes high when reading is completed, the master can issue the stop condition. After that, the status of EEPROM can be controlled). At this time, the port corresponding to the data line must always be in the high-impedance state (high-level output).
366
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(2) Slave operation The processing procedure of the slave operation is as follows. Basically, the slave operation is event-driven. Therefore, processing by the INTIIC0 interrupt (processing that must substantially change the operation status such as detection of a stop condition during communication) is necessary. In the following explanation, it is assumed that the extension code is not supported for data communication. It is also assumed that the INTIIC0 interrupt servicing only performs status transition processing, and that actual data communication is performed by the main processing.
INTIIC0 Interrupt servicing Setting IIC0 Data
Flag
Main processing
Setting
Therefore, data communication processing is performed by preparing the following three flags and passing them to the main processing instead of INTIIC0. <1> Communication mode flag This flag indicates the following two communication statuses. * Clear mode: Status in which data communication is not performed to stop condition detection, no detection of ACK from master, address mismatch) <2> Ready flag This flag indicates that data communication is enabled. Its function is the same as the INTIIC0 interrupt for ordinary data communication. This flag is set by interrupt servicing and cleared by the main processing. Clear this flag by interrupt servicing when communication is started. However, the ready flag is not set by interrupt servicing when the first data is transmitted. Therefore, the first data is transmitted without the flag being cleared (an address match is interpreted as a request for the next data). <3> Communication direction flag This flag indicates the direction of communication. Its value is the same as TRC0. * Communication mode: Status in which data communication is performed (from valid address detection
User's Manual U14260EJ3V1UD
367
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
The main processing of the slave operation is explained next. Start serial interface IIC0 and wait until communication is enabled. When communication is enabled, execute communication by using the communication mode flag and ready flag (processing of the stop condition and start condition is performed by an interrupt. Here, check the status by using the flags). The transmission operation is repeated until the master no longer returns ACK. If ACK is not returned from the master, communication is completed. For reception, the necessary amount of data is received. When communication is completed, ACK is not returned as the next data. After that, the master issues a stop condition or restart condition. Exit from the communication status occurs in this way. Figure 18-22. Slave Operation Flowchart (1/2)
START
IICC0 xxH IICE0 = 1
No
Communication mode? Yes Communication direction flag = 1? Yes WTIM0 = 1 WREL0 = 1 No ACKE0 = WTIM0 = 1
Data processing
Communication mode? Yes
No
IIC0 data
No
Ready? Yes
No
Communication mode? Read data. Yes Ready? Yes Clear ready flag. Data processing No Clear ready flag.
ACKD0 = 1? Yes WREL0 = 1 Clear communication mode flag.
No
No
Communication ends? Yes ACKE0 = 0 WREL0 = 1
368
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
An example of the processing procedure of the slave with the INTIIC0 interrupt is explained below (processing is performed assuming that no extension code is used). The INTIIC0 interrupt checks the status, and the following operations are performed. <1> Communication is stopped if the stop condition is issued. <2> If the start condition is issued, the address is checked and communication is completed if the address does not match. If the address matches, the communication mode is set, wait is cancelled, and processing returns from the interrupt (the ready flag is cleared). <3> For data transmit/receive, only the ready flag is set. Processing returns from the interrupt with the IIC0 bus remaining in the wait status. Remark <1> to <3> above correspond to <1> to <3> in Figure 18-22 Slave Operation Flowchart (2/2). Figure 18-22. Slave Operation Flowchart (2/2)
Generate INTIIC0
SPD0 = 1 No STD0 = 1 No <3>
Yes
<1>
Yes
<2>
COI0 = 1? Yes Communication direction flag TRC0 Set communication mode flag and clear ready flag.
No
Set ready flag
Complete interrupt servicing.
Complete interrupt servicing.
End processing
LREL0 = 1
Clear communication mode flag.
Complete interrupt servicing.
User's Manual U14260EJ3V1UD
369
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.5.16 Timing of I2C interrupt request (INTIIC0) occurrence The INTIIC0 interrupt request timing and the IIC status register 0 (IICS0) settings corresponding to that timing are described below. (1) Master device operation (a) Start ~ Address ~ Data ~ Data ~ Stop (normal transmission/reception) (i) When WTIM0 = 0
SPT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 D7-D0 AK 3 SP 4 5
1 : IICS0 = 1000x110B 2 : IICS0 = 1000x000B 3 : IICS0 = 1000x000B (Sets WTIM0) 4 : IICS0 = 1000xx00B (Sets SPT0) 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
SPT0 = 1 AK SP 3 4
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
1 : IICS0 = 1000x110B 2 : IICS0 = 1000x100B 3 : IICS0 = 1000xx00B (Sets SPT0) 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
370
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(b) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (restart) (i) When WTIM0 = 0
STT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 ST 3 AD6-AD0 RW AK 4 D7-D0 SPT0 = 1 AK 5 SP 6 7
1 : IICS0 = 1000x110B 2 : IICS0 = 1000x000B (Sets WTIM0) 3 : IICS0 = 1000xx00B (Clears WTIM0, sets STT0) 4 : IICS0 = 1000x110B 5 : IICS0 = 1000x000B (Sets WTIM0) 6 : IICS0 = 1000xx00B (Sets SPT0) 7 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
STT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK ST 2 AD6-AD0 RW AK 3 D7-D0 SPT0 = 1 AK SP 4 5
1 : IICS0 = 1000x110B 2 : IICS0 = 1000xx00B (Sets STT0) 3 : IICS0 = 1000x110B 4 : IICS0 = 1000xx00B (Sets SPT0) 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
371
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(c) Start ~ Code ~ Data ~ Data ~ Stop (extension code transmission) (i) When WTIM0 = 0
SPT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 D7-D0 AK 3 SP 4 5
1 : IICS0 = 1010x110B 2 : IICS0 = 1010x000B 3 : IICS0 = 1010x000B (Sets WTIM0) 4 : IICS0 = 1010xx00B (Sets SPT0) 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
SPT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 D7-D0 AK SP 3 4
1 : IICS0 = 1010x110B 2 : IICS0 = 1010x100B 3 : IICS0 = 1010xx00B (Sets SPT0) 4 : IICS0 = 00001001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
372
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(2) Slave device operation (slave address data reception time (matches with SVA0)) (a) Start ~ Address ~ Data ~ Data ~ Stop (i) When WTIM0 = 0
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK 3
SP 4
1 : IICS0 = 0001x110B 2 : IICS0 = 0001x000B 3 : IICS0 = 0001x000B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK
SP 3 4
1 : IICS0 = 0001x110B 2 : IICS0 = 0001x100B 3 : IICS0 = 0001xx00B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
373
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(b) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, matches with SVA0)
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK 4
SP 5
1 : IICS0 = 0001x110B 2 : IICS0 = 0001x000B 3 : IICS0 = 0001x110B 4 : IICS0 = 0001x000B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, matches with SVA0)
ST
AD6-AD0
RW
AK 1
D7-D0
AK
ST 2
AD6-AD0
RW
AK 3
D7-D0
AK
SP 4 5
1 : IICS0 = 0001x110B 2 : IICS0 = 0001xx00B 3 : IICS0 = 0001x110B 4 : IICS0 = 0001xx00B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
374
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(c) Start ~ Address ~ Data ~ Start ~ Code ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, extension code reception)
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK 4
SP 5
1 : IICS0 = 0001x110B 2 : IICS0 = 0001x000B 3 : IICS0 = 0010x010B 4 : IICS0 = 0010x000B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, extension code reception)
ST
AD6-AD0
RW
AK 1
D7-D0
AK
ST 2
AD6-AD0
RW
AK 3 4
D7-D0
AK
SP 5 6
1 : IICS0 = 0001x110B 2 : IICS0 = 0001xx00B 3 : IICS0 = 0010x010B 4 : IICS0 = 0010x110B 5 : IICS0 = 0010xx00B 6 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
375
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(d) Start ~ Address ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, does not match with address (= not extension code))
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK
SP 4
1 : IICS0 = 0001x110B 2 : IICS0 = 0001x000B 3 : IICS0 = 00000x10B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, does not match with address (= not extension code))
ST
AD6-AD0
RW
AK 1
D7-D0
AK
ST 2
AD6-AD0
RW
AK 3
D7-D0
AK
SP 4
1 : IICS0 = 0001x110B 2 : IICS0 = 0001xx00B 3 : IICS0 = 00000x10B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
376
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(3) Slave device operation (when receiving extension code) (a) Start ~ Code ~ Data ~ Data ~ Stop (i) When WTIM0 = 0
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK 3
SP 4
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x000B 3 : IICS0 = 0010x000B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
ST
AD6-AD0
RW
AK 1 2
D7-D0
AK 3
D7-D0
AK
SP 4 5
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x110B 3 : IICS0 = 0010x100B 4 : IICS0 = 0010xx00B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
377
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(b) Start ~ Code ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, matches with SVA0)
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK 4
SP 5
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x000B 3 : IICS0 = 0001x110B 4 : IICS0 = 0001x000B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, matches with SVA0)
ST
AD6-AD0
RW
AK 1 2
D7-D0
AK
ST 3
AD6-AD0
RW
AK 4
D7-D0
AK
SP 5 6
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x110B 3 : IICS0 = 0010xx00B 4 : IICS0 = 0001x110B 5 : IICS0 = 0001xx00B 6 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
378
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(c) Start ~ Code ~ Data ~ Start ~ Code ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, extension code reception)
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK 4
SP 5
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x000B 3 : IICS0 = 0010x010B 4 : IICS0 = 0010x000B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, extension code reception)
ST
AD6-AD0
RW
AK 1 2
D7-D0
AK
ST 3
AD6-AD0
RW
AK 4 5
D7-D0
AK
SP 6 7
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x110B 3 : IICS0 = 0010xx00B 4 : IICS0 = 0010x010B 5 : IICS0 = 0010x110B 6 : IICS0 = 0010xx00B 7 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
379
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(d) Start ~ Code ~ Data ~ Start ~ Address ~ Data ~ Stop (i) When WTIM0 = 0 (after restart, does not match with address (= not extension code))
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
ST
AD6-AD0
RW
AK 3
D7-D0
AK
SP 4
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x000B 3 : IICS0 = 00000x10B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1 (after restart, does not match with address (= not extension code))
ST
AD6-AD0
RW
AK 1 2
D7-D0
AK
ST 3
AD6-AD0
RW
AK 4
D7-D0
AK
SP 5
1 : IICS0 = 0010x010B 2 : IICS0 = 0010x110B 3 : IICS0 = 0010xx00B 4 : IICS0 = 00000x10B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(4) Operation without communication (a) Start ~ Code ~ Data ~ Data ~ Stop
ST
AD6-AD0
RW
AK
D7-D0
AK
D7-D0
AK
SP 1
1 : IICS0 = 00000001B Remark : Generated only when SPIE0 = 1
380
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(5) Arbitration loss operation (operation as slave after arbitration loss) (a) When arbitration loss occurs during transmission of slave address data (i) When WTIM0 = 0
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK 3
SP 4
1 : IICS0 = 0101x110B (Example When ALD0 is read during interrupt servicing) 2 : IICS0 = 0001x000B 3 : IICS0 = 0001x000B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK
SP 3 4
1 : IICS0 = 0101x110B (Example When ALD0 is read during interrupt servicing) 2 : IICS0 = 0001x100B 3 : IICS0 = 0001xx00B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
381
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(b) When arbitration loss occurs during transmission of extension code (i) When WTIM0 = 0
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK 3
SP 4
1 : IICS0 = 0110x010B (Example When ALD0 is read during interrupt servicing) 2 : IICS0 = 0010x000B 3 : IICS0 = 0010x000B 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
(ii) When WTIM0 = 1
ST
AD6-AD0
RW
AK 1 2
D7-D0
AK 3
D7-D0
AK
SP 4 5
1 : IICS0 = 0110x010B (Example When ALD0 is read during interrupt servicing) 2 : IICS0 = 0010x110B 3 : IICS0 = 0010x100B 4 : IICS0 = 0010xx00B 5 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
382
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(6) Operation when arbitration loss occurs (no communication after arbitration loss) (a) When arbitration loss occurs during transmission of slave address data (when WTIM0 = 1)
ST
AD6-AD0
RW
AK 1
D7-D0
AK
D7-D0
AK
SP 2
1 : IICS0 = 01000110B (Example When ALD0 is read during interrupt servicing) 2 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1
(b) When arbitration loss occurs during transmission of extension data
ST
AD6-AD0
RW
AK 1
D7-D0
AK
D7-D0
AK
SP 2
1 : IICS0 = 0110x010B (Example When ALD0 is read during interrupt servicing) Sets LREL0 = 1 by software 2 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
383
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(c) When arbitration loss occurs during transmission of data (i) When WTIM0 = 0
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK
SP 3
1 : IICS0 = 10001110B 2 : IICS0 = 01000000B (Example When ALD0 is read during interrupt servicing) 3 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1
(ii) When WTIM0 = 1
ST
AD6-AD0
RW
AK 1
D7-D0
AK 2
D7-D0
AK
SP 3
1 : IICS0 = 10001110B 2 : IICS0 = 01000100B (Example When ALD0 is read during interrupt servicing) 3 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1
384
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(d) When loss occurs due to restart condition during data transfer (i) Not extension code (Example: unmatches with SVA0, WTIM0 = 1)
ST
AD6-AD0
RW
AK 1
D7-Dn
ST
AD6-AD0
RW
AK 2
D7-D0
AK
SP 3
1 : IICS0 = 1000x110B 2 : IICS0 = 01000110B (Example When ALD0 is read during interrupt servicing) 3 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care n = 6 to 0
(ii) Extension code
ST
AD6-AD0
RW
AK 1
D7-Dn
ST
AD6-AD0
RW
AK 2
D7-D0
AK
SP 3
1 : IICS0 = 1000x110B 2 : IICS0 = 0110x010B (Example When ALD0 is read during interrupt servicing) Sets LREL0 = 1 by software 3 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care n = 6 to 0
User's Manual U14260EJ3V1UD
385
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(e) When loss occurs due to stop condition during data transfer
ST
AD6-AD0
RW
AK 1
D7-Dn
SP 2
1 : IICS0 = 1000x110B 2 : IICS0 = 01000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care n = 6 to 0
(f)
When arbitration loss occurs due to low-level data when attempting to generate a restart condition (i) When WTIM0 = 1
STT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 D7-D0 AK 3 D7-D0 AK SP 4
1 : IICS0 = 1000x110B 2 : IICS0 = 1000x100B (Sets STT0) 3 : IICS0 = 01000100B (Example When ALD0 is read during interrupt servicing) 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care (g) When arbitration loss occurs due to a stop condition when attempting to generate a restart condition (i) When WTIM0 = 1
STT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK SP 2 3
1 : IICS0 = 1000x110B 2 : IICS0 = 1000xx00B (Sets STT0) 3 : IICS0 = 01000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
386
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
(h) When arbitration loss occurs due to low-level data when attempting to generate a stop condition (i) When WTIM0 = 1
SPT0 = 1 ST AD6-AD0 RW AK 1 D7-D0 AK 2 D7-D0 AK 3 D7-D0 AK SP 4
1 : IICS0 = 1000x110B 2 : IICS0 = 1000xx00B (Sets SPT0) 3 : IICS0 = 01000000B (Example When ALD0 is read during interrupt servicing) 4 : IICS0 = 00000001B Remark : Always generated : Generated only when SPIE0 = 1 x : Don't care
User's Manual U14260EJ3V1UD
387
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
18.6
Timing Charts
When using the I2C bus mode, the master device outputs an address via the serial bus to select one of several slave devices as its communication partner. After outputting the slave address, the master device transmits the TRC0 bit (bit 3 of IIC status register 0 (IICS0)), which specifies the data transfer direction, and then starts serial communication with the slave device. Figures 18-23 and 18-24 show timing charts of the data communication. IIC shift register 0 (IIC0)'s shift operation is synchronized with the falling edge of the serial clock (SCL0). The transmit data is transferred to the SO0 latch and is output (MSB first) via the SDA0 pin. Data input via the SDA0 pin is captured into IIC0 at the rising edge of SCL0.
388
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-23. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (1/3) (1) Start condition ~ address
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 H Transmit L L H H IIC0 address IIC0 data
Transfer lines SCL0 SDA0 1 A6 Start condition Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 (When EXC0 = 1) TRC0 L Receive H H L L L Note IIC0 FFH Note 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8 W 9 ACK 1 D7 2 D6 3 D5 4 D4
Note To cancel slave wait, write "FFH" to IIC0 or set WREL0.
User's Manual U14260EJ3V1UD
389
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-23. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (2/3) (2) Data
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 H Transmit L L H H H L L L IIC0 data IIC0 data
Transfer lines SCL0 SDA0 8 D0 9 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 9 1 D7 2 D6 3 D5
Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 L Receive L L H H L L L Note Note IIC0 FFH Note IIC0 FFH Note
Note To cancel slave wait, write "FFH" to IIC0 or set WREL0.
390
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-23. Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (3/3) (3) Stop condition
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 (When SPIE0 = 1) TRC0 H Transmit L H H IIC0 data IIC0 address
Transfer lines SCL0 SDA0 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 Stop condition IIC0 FFH Note Start condition 9 1 A6 2 A5
Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 H H L L L Note IIC0 FFH Note
Note
(When SPIE0 = 1) TRC0 L Receive
Note To cancel slave wait, write "FFH" to IIC0 or set WREL0.
User's Manual U14260EJ3V1UD
391
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-24. Example of Slave to Master Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (1/3) (1) Start condition ~ address
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 Transfer lines SCL0 SDA0 1 A6 Start condition Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 H H L L L L IIC0 data 2 A5 3 A4 4 A3 5 A2 6 A1 7 A0 8 R 9 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 L Note H H IIC0 address IIC0 FFH Note
Note To cancel master wait, write "FFH" to IIC0 or set WREL0.
392
User's Manual U14260EJ3V1UD
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-24. Example of Slave to Master Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (2/3) (2) Data
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 L Receive L L H H H L L Note Note IIC0 FFH Note IIC0 FFH Note
Transfer lines SCL0 SDA0 8 D0 9 ACK 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 9 ACK D7 1 2 D6 3 D5
Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 TRC0 H Transmit L L H H L L L L IIC0 data IIC0 data
Note To cancel master wait, write "FFH" to IIC0 or set WREL0.
User's Manual U14260EJ3V1UD
393
CHAPTER 18
SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Figure 18-24. Example of Slave to Master Communication (When 9-Clock Wait Is Selected for Both Master and Slave) (3/3) (3) Stop condition
Processing by master device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 (When SPIE0 = 1) TRC0 Transfer lines SCL0 SDA0 1 D7 2 D6 3 D5 4 D4 5 D3 6 D2 7 D1 8 D0 9 N-ACK Stop condition Processing by slave device IIC0 ACKD0 STD0 SPD0 WTIM0 ACKE0 MSTS0 STT0 SPT0 WREL0 INTIIC0 (When SPIE0 = 1) TRC0 H H L L L IIC0 data 1 A6 Start condition 2 A5 Note H IIC0 FFH Note IIC0 address
Note To cancel master wait, write "FFH" to IIC0 or set WREL0.
394
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
19.1 Interrupt Function Types
The following three types of interrupt functions are used. (1) Non-maskable interrupts A non-maskable interrupt is acknowledged even when interrupts are disabled. It does not undergo priority control and is given top priority over all other interrupt requests. However, interrupt requests are held pending during non-maskable interrupt servicing. A non-maskable interrupt generates a standby release signal and releases the HALT mode during main system clock operation. The only non-maskable interrupt in the PD780078 Subseries is the interrupt from the watchdog timer. (2) Maskable interrupts These interrupts undergo mask control. Maskable interrupts can be divided into a high interrupt priority group and a low interrupt priority group by setting the priority specification flag registers (PR0L, PR0H, PR1L). High priority interrupts can be serviced preferentially to low priority interrupts (multiple interrupt servicing). If two or more interrupts with the same priority are generated simultaneously, each interrupt has a predetermined priority (see Table 19-1). A standby release signal is generated and the STOP mode and HALT mode are released. Five external interrupt requests and 18 internal interrupt requests (19 internal interrupt requests for the
PD780078Y Subseries) are incorporated as maskable interrupts.
(3) Software interrupts A software interrupt is a vectored interrupt that is generated by executing the BRK instruction. It is acknowledged even when interrupts are disabled. A software interrupt does not undergo interrupt priority control.
19.2 Interrupt Sources and Configuration
A total of 25 interrupt sources (26 interrupt sources for the PD780078Y Subseries) exist among non-maskable, maskable, and software interrupts (see Table 19-1). Remark A non-maskable interrupt or maskable interrupt (internal) can be selected as the watchdog timer interrupt source (INTWDT).
User's Manual U14260EJ3V1UD
395
CHAPTER 19
INTERRUPT FUNCTIONS
Table 19-1. Interrupt Source List (1/2)
Type of Interrupt Nonmaskable Maskable Default PriorityNote 1 -- Name INTWDT Interrupt Source Trigger Watchdog timer overflow (non-maskable interrupt selected) Watchdog timer overflow (interval timer selected) Pin input edge detection External 0006H 0008H 000AH 000CH Generation of UART0 reception error End of UART0 reception End of UART0 transmission End of CSI1 communication End of SIO3 communication End of IIC0 communication Reference time interval signal from watch timer Match of TM00 and CR000 (when compare register is specified) Detection of valid edge of TI010 (when capture register is specified) Match of TM00 and CR010 (when compare register is specified) Detection of valid edge of TI000 (when capture register is specified) Match of TM50 and CR50 Match of TM51 and CR51 End of conversion by A/D converter Watch timer overflow Falling edge detection of port 4 External Internal 000EH 0010H 0012H 0014H 0016H 0018H 001AH 001CH (B) Internal/ External Internal Vector Table Address 0004H Basic Configuration TypeNote 2 (A)
0
INTWDT
(B)
1 2 3 4 5 6 7 8 9 10 11 12
INTP0 INTP1 INTP2 INTP3 INTSER0 INTSR0 INTST0 INTCSI1 INTCSI3 INTIIC0Note 3 INTWTI INTTM000
(C)
13
INTTM010
001EH
14 15 16 17 18
INTTM50 INTTM51 INTAD0 INTWT INTKR
0020H 0022H 0024H 0026H 0028H (D)
Notes 1. The default priority is the priority order when two or more maskable interrupt requests are generated simultaneously. 0 is the highest and 23 is the lowest. 2. Basic configuration types (A) to (E) correspond to (A) to (E) in Figure 19-1. 3. PD780078Y Subseries only.
396
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
Table 19-1. Interrupt Source List (2/2)
Type of Interrupt Maskable Default PriorityNote 1 19 20 21 22 Name INTSER2 INTSR2 INTST2Note 3 INTTM001 Interrupt Source Trigger Generation of UART2 reception error End of UART2 reception End of UART2 transmissionNote 4/data transferNote 5 Internal/ External Internal Vector Table Address 002AH 002CH 002EH 0030H Basic Configuration TypeNote 2 (B)
Match of TM01 and CR001 (when compare register is specified) Detection of valid edge of TI011 (when capture register is specified) Match of TM01 and CR011 (when compare register is specified) Detection of valid edge of TI001 (when capture register is specified) BRK instruction execution --
23
INTTM011
0032H
Software
--
BRK
003EH
(E)
Notes 1. The default priority is the priority order when two or more maskable interrupt requests are generated simultaneously. 0 is the highest and 23 is the lowest. 2. Basic configuration types (A) to (E) correspond to (A) to (E) in Figure 19-1. 3. Interrupt sources can be selected by the transmit interrupt signal select flag (ISMD2). 4. An interrupt request signal is generated when all the data in transmit buffer register 2 (TXB2) has been transmitted. 5. An interrupt request signal is generated when data transfer is completed from TXB2 to the transmit shift register (TXS2).
User's Manual U14260EJ3V1UD
397
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-1. Basic Configuration of Interrupt Function (1/2) (A) Internal non-maskable interrupt
Internal bus
Interrupt request
Priority controller
Vector table address generator
Standby release signal
(B) Internal maskable interrupt
Internal bus
MK
IE
PR
ISP
Interrupt request
IF
Priority controller
Vector table address generator
Standby release signal
(C) External maskable interrupt (INTP0 to INTP3)
Internal bus
External interrupt edge enable register (EGP, EGN)
MK
IE
PR
ISP
Interrupt request
Edge detector
IF
Priority controller
Vector table address generator
Standby release signal
398
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-1. Basic Configuration of Interrupt Function (2/2) (D) External maskable interrupt (INTKR)
Internal bus
MK
IE
PR
ISP
Interrupt request
Falling edge detector 1 when MEM = 01H
IF
Priority controller
Vector table address generator
Standby release signal
(E) Software interrupt
Internal bus
Interrupt request
Vector table address generator
IF: IE: ISP: MK: PR:
Interrupt request flag Interrupt enable flag In-service priority flag Interrupt mask flag Priority specification flag
MEM: Memory expansion mode register
User's Manual U14260EJ3V1UD
399
CHAPTER 19
INTERRUPT FUNCTIONS
19.3 Interrupt Function Control Registers
The following 6 types of registers are used to control the interrupt functions. * * * * * * Interrupt request flag register (IF0L, IF0H, IF1L) Interrupt mask flag register (MK0L, MK0H, MK1L) Priority specification flag register (PR0L, PR0H, PR1L) External interrupt rising edge enable register (EGP) External interrupt falling edge enable register (EGN) Program status word (PSW)
Table 19-2 gives a list of interrupt request flags, interrupt mask flags, and priority specification flags corresponding to interrupt request sources. Table 19-2. Flags Corresponding to Interrupt Request Sources
Interrupt Source Interrupt Request Flag Register INTWDT INTP0 INTP1 INTP2 INTP3 INTSER0 INTSR0 INTST0 INTCSI1 INTCSI3 INTIIC0Note 2 INTWTI INTTM000 INTTM010 INTTM50 INTTM51 INTAD0 INTWT INTKR INTSER2 INTSR2 INTST2 INTTM001 INTTM011 WDTIFNote 1 PIF0 PIF1 PIF2 PIF3 SERIF0 SRIF0 STIF0 CSIIF1 CSIIF3 IICIF0Note 2 WTIIF0 TMIF000 TMIF010 TMIF50 TMIF51 ADIF0 WTIF KRIF SERIF2 SRIF2 STIF2 TMIF001 TMIF011 IF0H IF0L WDTMKNote 1 PMK0 PMK1 PMK2 PMK3 SERMK0 SRMK0 STMK0 CSIMK1 CSIMK3 IICMK0Note 2 WTIMK0 TMMK000 TMMK010 TMMK50 TMMK51 ADMK0 WTMK KRMK SERMK2 SRMK2 STMK2 TMMK001 TMMK011 MK0H Interrupt Mask Flag Register MK0L WDTPRNote 1 PPR0 PPR1 PPR2 PPR3 SERPR0 SRPR0 STPR0 CSIPR1 CSIPR3 IICPR0Note 2 WTIPR0 TMPR000 TMPR010 TMPR50 TMPR51 ADPR0 WTPR KRPR SERPR2 SRPR2 STPR2 TMPR001 TMPR011 PR0H Priority Specification Flag Register PR0L
IF1L
MK1L
PR1L
Notes 1. Interrupt control flag when watchdog timer is used as interval timer 2. PD780078Y Subseries only
400
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
(1) Interrupt request flag registers (IF0L, IF0H, IF1L) An interrupt request flag is set to 1 when the corresponding interrupt request is generated or an instruction is executed. It is cleared to 0 when an instruction is executed upon acknowledgment of an interrupt request or upon RESET input. When an interrupt is acknowledged, the interrupt request flag is automatically cleared, and then the interrupt routine is executed. IF0L, IF0H, and IF1L are set by a 1-bit or 8-bit memory manipulation instruction. When IF0L and IF0H are combined to form 16-bit register IF0, they are read by a 16-bit memory manipulation instruction. RESET input clears IF0L, IF0H, and IF1L to 00H. Figure 19-2. Format of Interrupt Request Flag Register (IF0L, IF0H, IF1L)
Address: FFE0H After reset: 00H R/W Symbol IF0L 7 STIF0 6 SRIF0 5 SERIF0 4 PIF3 3 PIF2 2 PIF1 1 PIF0 0 WDTIF
Address: FFE1H After reset: 00H R/W Symbol IF0H 7 TMIF51 6 TMIF50 5 TMIF010 4 TMIF000 3 WTIIF0 2 IICIF0Note 1 CSIIF3 0 CSIIF1
Address: FFE2H After reset: 00H R/W Symbol IF1L 7 TMIF011 6 TMIF001 5 STIF2 4 SRIF2 3 SERIF2 2 KRIF 1 WTIF 0 ADIF0
XXIFX 0 1
Interrupt request flag No interrupt request signal is generated Interrupt request signal is generated, interrupt request status
Note
Incorporated only in the PD780078Y Subseries. Be sure to set 0 for the PD780078 Subseries.
Cautions 1. The WDTIF flag is R/W enabled only when the watchdog timer is used as an interval timer. If watchdog timer mode 1 is used, set the WDTIF flag to 0. 2. When operating a timer, serial interface, or A/D converter after standby release, operate it after clearing the interrupt request flag, because interrupt request flags may be set by noise. 3. When manipulating a flag of the interrupt request flag register, use a 1-bit memory manipulation instruction (CLR1). When describing in C language, use a bit manipulation instruction such as "IF0L.0 = 0;" or "_asm("clr1 IF0L, 0");" because the compiled assembler must be a 1-bit memory manipulation instruction (CLR1). If a program is described in C language using an 8-bit memory manipulation instruction such as "IF0L &= 0xfe;" and compiled, it becomes the assembler of three instructions. mov a, IF0L and a, #0FEH mov IF0L, a In this case, even if the request flag of another bit of the same interrupt request flag register (IF0L) is set to 1 at the timing between "mov a, IF0L" and "mov IF0L, a", the flag is cleared to 0 at "mov IF0L, a". Therefore, care must be exercised when using an 8-bit memory manipulation instruction in C language.
User's Manual U14260EJ3V1UD
401
CHAPTER 19
INTERRUPT FUNCTIONS
(2) Interrupt mask flag registers (MK0L, MK0H, MK1L) The interrupt mask flags are used to enable/disable the corresponding maskable interrupt servicing. MK0L, MK0H, and MK1L are set by a 1-bit or 8-bit memory manipulation instruction. When MK0L and MK0H are combined to form 16-bit register MK0, they are set by a 16-bit memory manipulation instruction. RESET input sets MK0L, MK0H, and MK1L to FFH. Figure 19-3. Format of Interrupt Mask Flag Register (MK0L, MK0H, MK1L)
Address: FFE4H After reset: FFH R/W Symbol MK0L 7 STMK0 6 SRMK0 5 SERMK0 4 PMK3 3 PMK2 2 PMK1 1 PMK0 0 WDTMK
Address: FFE5H After reset: FFH R/W Symbol MK0H 7 TMMK51 6 TMMK50 5 TMMK010 4 TMMK000 3 WTIMK0 2 IICMK0Note 1 CSIMK3 0 CSIMK1
Address: FFE6H After reset: FFH R/W Symbol MK1L 7 TMMK011 6 TMMK001 5 STMK2 4 SRMK2 3 SERMK2 2 KRMK 1 WTMK 0 ADMK0
XXMKX 0 1 Interrupt servicing enabled Interrupt servicing disabled
Interrupt servicing control
Note
Incorporated only in the PD780078Y Subseries. Be sure to set 1 for the PD780078 Subseries.
Cautions 1. If the watchdog timer is used in watchdog timer mode 1, the contents of the WDTMK flag become undefined when read. 2. Because port 0 pins have an alternate function as external interrupt request inputs, when the output level is changed by specifying the output mode of the port function, an interrupt request flag is set. Therefore, the interrupt mask flag should be set to 1 before using the output mode.
402
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
(3) Priority specification flag registers (PR0L, PR0H, PR1L) The priority specification flag registers are used to set the corresponding maskable interrupt priority order. PR0L, PR0H, and PR1L are set by a 1-bit or 8-bit memory manipulation instruction. If PR0L and PR0H are combined to form 16-bit register PR0, they are set by a 16-bit memory manipulation instruction. RESET input sets PR0L, PR0H, and PR1L to FFH. Figure 19-4. Format of Priority Specification Flag Register (PR0L, PR0H, PR1L)
Address: FFE8H After reset: FFH R/W Symbol PR0L 7 STPR0 6 SRPR0 5 SERPR0 4 PPR3 3 PPR2 2 PPR1 1 PPR0 0 WDTPR
Address: FFE9H After reset: FFH R/W Symbol PR0H 7 TMPR51 6 TMPR50 5 TMPR010 4 TMPR000 3 WTIPR0 2 IICPR0Note 1 CSIPR3 0 CSIPR1
Address: FFEAH After reset: FFH R/W Symbol PR1L 7 TMPR011 6 TMPR001 5 STPR2 4 SRPR2 3 SERPR2 2 KRPR 1 WTPR 0 ADPR0
XXPRX 0 1 High priority level Low priority level
Priority level selection
Note
Incorporated only in the PD780078Y Subseries. Be sure to set 1 for the PD780078 Subseries. When the watchdog timer is used in watchdog timer mode 1, set the WDTPR flag to 1.
Caution
User's Manual U14260EJ3V1UD
403
CHAPTER 19
INTERRUPT FUNCTIONS
(4) External interrupt rising edge enable register (EGP), external interrupt falling edge enable register (EGN) These registers specify the valid edge for INTP0 to INTP3. EGP and EGN are set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears EGP and EGN to 00H. Figure 19-5. Format of External Interrupt Rising Edge Enable Register (EGP) and External Interrupt Falling Edge Enable Register (EGN)
Address: FF48H After reset: 00H R/W Symbol EGP 7 0 6 0 5 0 4 0 3 EGP3 2 EGP2 1 EGP1 0 EGP0
Address: FF49H After reset: 00H R/W Symbol EGN 7 0 6 0 5 0 4 0 3 EGN3 2 EGN2 1 EGN1 0 EGN0
EGPn 0 0 1 1
EGNn 0 1 0 1
INTPn pin valid edge selection (n = 0 to 3) Edge detection disabled Falling edge Rising edge Both rising and falling edges
Table 19-3 shows the ports corresponding to EGPn and EGNn. Table 19-3. Ports Corresponding to EGPn and EGNn
Detection Enable Register EGP0 EGP1 EGP2 EGP3 EGN0 EGN1 EGN2 EGN3 Edge Detection Port P00 P01 P02 P03 Interrupt Request Signal INTP0 INTP1 INTP2 INTP3
Caution When the function is switched from external interrupt request to port, edge detection may be performed. Therefore, clear EGPn and EGNn to 0 before switching to the port mode. Remark n = 0 to 3
404
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
(5) Program status word (PSW) The program status word is a register used to hold the instruction execution results and the current status for an interrupt request. An IE flag to set maskable interrupt enable/disable and an ISP flag to control nesting processing are mapped to the PSW. Besides 8-bit read/write, this register can be operated by bit manipulation and dedicated (EI and DI) instructions. When a vectored interrupt request is acknowledged, if the BRK instruction is executed, the contents of the PSW are automatically saved into a stack and the IE flag is reset to 0. If a maskable interrupt request is acknowledged, the contents of the priority specification flag of the acknowledged interrupt are transferred to the ISP flag. The PSW contents are also saved into the stack with the PUSH PSW instruction. They are reset from the stack with the RETI, RETB, and POP PSW instructions. RESET input sets PSW to 02H. Figure 19-6. Format of Program Status Word
After reset 02H Used when normal instruction is executed ISP 0 Priority of interrupt currently being serviced High-priority interrupt servicing (low-priority interrupts disabled) Interrupt request not acknowledged, or lowpriority interrupt servicing (all maskable interrupts enabled)
7 PSW IE
6 Z
5 RBS1
4 AC
3 RBS0
2 0
1 ISP
0 CY
1
IE 0 1
Interrupt request acknowledgment enable/disable Disable Enable
User's Manual U14260EJ3V1UD
405
CHAPTER 19
INTERRUPT FUNCTIONS
19.4 Interrupt Servicing Operations
19.4.1 Non-maskable interrupt request acknowledgment operation A non-maskable interrupt request is unconditionally acknowledged even in an interrupt acknowledgment disabled state. It does not undergo interrupt priority control and has the highest priority of all interrupts. If a non-maskable interrupt request is acknowledged, the contents are saved into the stacks in the order of PSW, then PC, the IE flag and ISP flag are reset (0), and the contents of the vector table are loaded into the PC and branched. This disables the acknowledgment of multiple interrupts. A new non-maskable interrupt request generated during execution of a non-maskable interrupt servicing program is acknowledged after the current non-maskable interrupt servicing program is terminated (following RETI instruction execution) and one main routine instruction has been executed. However, if a new non-maskable interrupt request is generated twice or more during non-maskable interrupt servicing program execution, only one non-maskable interrupt request is acknowledged after termination of the non-maskable interrupt servicing program. Figures 19-7, 19-8, and 19-9 show the flowchart of non-maskable interrupt request generation through acknowledgment, the acknowledgment timing of a non-maskable interrupt request, and the acknowledgment operation when multiple non-maskable interrupt requests are generated, respectively. Caution Be sure to use the RETI instruction to restore processing from the non-maskable interrupt.
406
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-7. Flowchart of Non-Maskable Interrupt Request Generation to Acknowledgment
Start
WDTM4 = 1 (with watchdog timer mode selected)?
No Interval timer
Yes
Overflow in WDT?
No
Yes
WDTM3 = 0 (with non-maskable interrupt selected)?
No Reset processing
Yes Interrupt request generation
WDT interrupt servicing? Yes Interrupt control register not accessed? Yes Start of interrupt servicing WDTM: Watchdog timer mode register WDT: Watchdog timer
No
Interrupt request held pending
No
Figure 19-8. Non-Maskable Interrupt Request Acknowledgment Timing
CPU processing
Instruction
Instruction
PSW, PC save, jump to interrupt servicing
Interrupt service program
WDTIF Interrupt request generated during this interval is acknowledged at WDTIF: Watchdog timer interrupt request flag .
User's Manual U14260EJ3V1UD
407
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-9. Non-Maskable Interrupt Request Acknowledgment Operation (a) If a non-maskable interrupt request is generated during non-maskable interrupt servicing program execution
Main routine
NMI request <1> NMI request <2> Execution of 1 instruction
Execution of NMI request <1> NMI request <2> held pending
Servicing of pending NMI request <2>
(b) If two non-maskable interrupt requests are generated during non-maskable interrupt servicing program execution
Main routine
NMI request <1> NMI request <2> Execution of 1 instruction NMI request <3>
Execution of NMI request <1> NMI request <2> held pending NMI request <3> held pending
Servicing of pending NMI request <2>
NMI request <3> not acknowledged (Although two or more NMI requests have been generated, only one request is acknowledged.)
408
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
19.4.2 Maskable interrupt request acknowledgment operation A maskable interrupt request becomes acknowledgeable when an interrupt request flag is set to 1 and the mask (MK) flag corresponding to that interrupt request is cleared to 0. A vectored interrupt request is acknowledged if interrupts are enabled (when the IE flag is set to 1). However, a low-priority interrupt request is not acknowledged during servicing of a higher priority interrupt request (when the ISP flag is reset to 0). Moreover, even if the EI instruction is executed during execution of a non-maskable interrupt servicing program, neither non-maskable interrupt requests nor maskable interrupt requests are acknowledged. The times from generation of a maskable interrupt request until interrupt servicing is performed are listed in Table 19-4 below. For the interrupt request acknowledgment timing, see Figures 19-11 and 19-12. Table 19-4. Times from Generation of Maskable Interrupt Request Until Servicing
Minimum Time When xxPR = 0 When xxPR = 1 7 clocks 8 clocks Maximum TimeNote 32 clocks 33 clocks
Note If an interrupt request is generated just before a divide instruction, the wait time becomes longer. Remark 1 clock: 1/fCPU (fCPU: CPU clock) If two or more maskable interrupt requests are generated simultaneously, the request with a higher priority level specified by the priority specification flag is acknowledged first. If two or more interrupt requests have the same priority level, the request with the highest default priority is acknowledged first. An interrupt request that is held pending is acknowledged when it becomes acknowledgeable. Figure 19-10 shows the interrupt request acknowledgment algorithm. If a maskable interrupt request is acknowledged, the contents are saved into the stacks in the order of PSW, then PC, the IE flag is reset (0), and the contents of the priority specification flag corresponding to the acknowledged interrupt are transferred to the ISP flag. Further, the vector table data determined for each interrupt request is loaded into the PC and branched. Return from an interrupt is possible using the RETI instruction.
User's Manual U14260EJ3V1UD
409
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-10. Interrupt Request Acknowledgment Processing Algorithm
Start
No
xxIF = 1? Yes (Interrupt request generation)
No
xxMK = 0? Yes
Interrupt request held pending Yes (High priority)
xxPR = 0? No (Low priority)
Yes
Any high-priority interrupt request among those simultaneously generated with xxPR = 0?
Interrupt request held pending No No IE = 1? Yes
Any interrupt request among those simultaneously generated with xxPR = 0?
Yes
No
Any high-priority interrupt request among those simultaneously generated?
Interrupt request held pending
Yes
Interrupt request held pending
No Vectored interrupt servicing IE = 1? Yes ISP = 1? Yes
Interrupt request held pending No
Interrupt request held pending No
Interrupt request held pending
Vectored interrupt servicing
xxIF: xxMK: xxPR: IE: ISP:
Interrupt request flag Interrupt mask flag Priority specification flag Flag that controls acknowledgment of maskable interrupt requests (1 = Enable, 0 = Disable) Flag that indicates the priority level of the interrupt currently being serviced (0 = High-priority interrupt servicing, 1 = No interrupt request received, or low-priority interrupt servicing)
410
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-11. Interrupt Request Acknowledgment Timing (Minimum Time)
6 clocks CPU processing xxIF (xxPR = 1) 8 clocks xxIF (xxPR = 0) 7 clocks Instruction Instruction
PSW and PC save, jump to interrupt servicing
Interrupt servicing program
Remark 1 clock: 1/fCPU (fCPU: CPU clock)
Figure 19-12. Interrupt Request Acknowledgment Timing (Maximum Time)
25 clocks CPU processing xxIF (xxPR = 1) 33 clocks xxIF (xxPR = 0) 32 clocks Instruction Divide instruction
6 clocks
PSW and PC save, jump to interrupt servicing
Interrupt servicing program
Remark 1 clock: 1/fCPU (fCPU: CPU clock) 19.4.3 Software interrupt request acknowledgment operation
A software interrupt request is acknowledged by BRK instruction execution. Software interrupts cannot be disabled. If a software interrupt request is acknowledged, the contents are saved into the stacks in the order of the program status word (PSW), then program counter (PC), the IE flag is reset (0), and the contents of the vector table (003EH, 003FH) are loaded into the PC and branched. Return from a software interrupt is possible with the RETB instruction. Caution Do not use the RETI instruction for returning from a software interrupt.
User's Manual U14260EJ3V1UD
411
CHAPTER 19
INTERRUPT FUNCTIONS
19.4.4 Multiple interrupt servicing Multiple interrupt servicing occurs when an interrupt request is acknowledged during execution of another interrupt. Multiple interrupt servicing does not occur unless the interrupt request acknowledgment enable state is selected (IE = 1) (except non-maskable interrupts). When an interrupt request is received, interrupt request acknowledgment becomes disabled (IE = 0). Therefore, to enable multiple interrupt servicing, it is necessary to set (1) the IE flag with the EI instruction during interrupt servicing to enable interrupt acknowledgment. Moreover, even if interrupts are enabled, multiple interrupt servicing may not be enabled, this being subject to interrupt priority control. Two types of priority control are available: default priority control and programmable priority control. Programmable priority control is used for multiple interrupt servicing. In the interrupt enabled state, if an interrupt request with a priority equal to or higher than that of the interrupt currently being serviced is generated, it is acknowledged for multiple interrupt servicing. If an interrupt with a priority lower than that of the interrupt currently being serviced is generated during interrupt servicing, it is not acknowledged for multiple interrupt servicing. Interrupt requests that are not enabled because of the interrupt disabled state or they have a lower priority are held pending. When servicing of the current interrupt ends, the pending interrupt request is acknowledged following execution of at least one main processing instruction. Multiple interrupt servicing is not possible during non-maskable interrupt servicing. Table 19-5 shows relationship between interrupt requests enabled for multiple interrupt servicing and Figure 1913 shows multiple interrupt servicing examples. Table 19-5. Relationship Between Interrupt Requests Enabled for Multiple Interrupt Servicing
Maskable Interrupt Request Non-Maskable Interrupt Request x ISP = 0 ISP = 1 Software interrupt x PR = 0 IE = 1 IE = 0 x x x x PR = 1 IE = 1 x x IE = 0 x x x x
Multiple Interrupt Request Interrupt Being Serviced Non-maskable interrupt Maskable interrupt
Software Interrupt Request
Remarks 1.
: Multiple interrupt servicing enabled
2. x: Multiple interrupt servicing disabled 3. ISP and IE are flags contained in the PSW. ISP = 0: An interrupt with higher priority is being serviced. ISP = 1: No interrupt request has been acknowledged, or an interrupt with a lower priority is being serviced. IE = 0: IE = 1: Interrupt request acknowledgment is disabled. Interrupt request acknowledgment is enabled.
4. PR is a flag contained in PR0L, PR0H, and PR1L. PR = 0: Higher priority level PR = 1: Lower priority level
412
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-13. Examples of Multiple Interrupt Servicing (1/2) Example 1. Multiple interrupt servicing occurs twice
Main processing
INTxx servicing
INTyy servicing
INTzz servicing
EI
IE = 0 EI INTyy (PR = 0)
IE = 0 EI INTzz (PR = 0)
IE = 0
INTxx (PR = 1)
RETI IE = 1 RETI IE = 1 RETI IE = 1
During servicing of interrupt INTxx, two interrupt requests, INTyy and INTzz, are acknowledged, and multiple interrupt servicing takes place. Before each interrupt request is acknowledged, the EI instruction must always be issued to enable interrupt request acknowledgment. Example 2. Nesting does not occur due to priority control
Main processing INTxx servicing INTyy servicing
EI
IE = 0 EI
INTxx (PR = 0) IE = 1
INTyy (PR = 1)
RETI
1 instruction execution
IE = 0
RETI IE = 1
Interrupt request INTyy issued during servicing of interrupt INTxx is not acknowledged because its priority is lower than that of INTxx, and multiple interrupt servicing does not take place. The INTyy interrupt request is held pending, and is acknowledged following execution of one main processing instruction. PR = 0: PR = 1: IE = 0: Higher priority level Lower priority level Interrupt request acknowledgment disabled
User's Manual U14260EJ3V1UD
413
CHAPTER 19
INTERRUPT FUNCTIONS
Figure 19-13. Examples of Multiple Interrupt Servicing (2/2) Example 3. Multiple interrupt servicing does not occur because interrupts are not enabled
Main processing IE = 0 EI INTyy (PR = 0) RETI IE = 1 INTxx servicing INTyy servicing
INTxx (PR = 0)
1 instruction execution
IE = 0
RETI IE = 1
Interrupts are not enabled during servicing of interrupt INTxx (EI instruction is not issued), so interrupt request INTyy is not acknowledged and multiple interrupt servicing does not take place. The INTyy interrupt request is held pending, and is acknowledged following execution of one main processing instruction. PR = 0: IE = 0: Higher priority level Interrupt request acknowledgment disabled
414
User's Manual U14260EJ3V1UD
CHAPTER 19
INTERRUPT FUNCTIONS
19.4.5 Interrupt request hold There are instructions where, even if an interrupt request is issued for them while another instruction is being executed, request acknowledgment is held pending until the end of execution of the next instruction. These instructions (interrupt request hold instructions) are listed below. * * * * * * * * * * * * * * * * * * * * MOV PSW, #byte MOV A, PSW MOV PSW, A MOV1 PSW. bit, CY MOV1 CY, PSW. bit AND1 CY, PSW. bit OR1 CY, PSW. bit XOR1 CY, PSW. bit SET1 PSW. bit CLR1 PSW. bit RETB RETI PUSH PSW POP PSW BT PSW. bit, $addr16 BF PSW. bit, $addr16 BTCLR PSW. bit, $addr16 EI DI Manipulation instructions for the IF0L, IF0H, IF1L, MK0L, MK0H, MK1L, PR0L, PR0H, and PR1L registers The BRK instruction is not one of the above-listed interrupt request hold instructions. However, the software interrupt activated by executing the BRK instruction causes the IE flag to be cleared to 0. Therefore, even if a maskable interrupt request is generated during execution of the BRK instruction, the interrupt request is not acknowledged. However, a non-maskable interrupt request is acknowledged. Figure 19-14 shows the timing at which interrupt requests are held pending. Figure 19-14. Interrupt Request Hold
Caution
CPU processing
Instruction N
Instruction M
Save PSW and PC, jump to interrupt servicing
Interrupt servicing program
xxIF
Remarks 1. Instruction N: Interrupt request hold instruction 2. Instruction M: Instruction other than interrupt request hold instruction 3. The xxPR (priority level) values do not affect the operation of xxIF (interrupt request).
User's Manual U14260EJ3V1UD
415
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Use the expanded-specification products of the PD780076, 780078, and 78F0078, under the conventionalspecification conditions (fX = 8.38 MHz: VDD = 4.0 to 5.5 V, fX = 5 MHz: VDD = 2.7 to 5.5 V, fX = 1.25 MHz: VDD = 1.8 to 5.5 V). The external device expansion function cannot be used under the expanded-specification conditions (high-speed operation).
20.1 External Device Expansion Function
The external device expansion function connects external devices to areas other than the internal ROM, RAM, and SFR. Connection of external devices uses ports 4 to 6. Ports 4 to 6 control address/data, read/write strobe, wait, address strobe, etc. Table 20-1. Pin Functions in External Memory Expansion Mode
Pin Function When External Device Is Connected Alternate Function Name AD0 to AD7 A8 to A15 RD WR WAIT ASTB Function Multiplexed address/data bus Address bus Read strobe signal Write strobe signal Wait signal Address strobe signal P40 to P47 P50 to P57 P64 P65 P66 P67
Table 20-2. State of Port 4 to 6 Pins in External Memory Expansion Mode
Port External Expansion Mode Single-chip mode 256-byte expansion mode 4 KB expansion mode 16 KB expansion mode Full-address mode Port Address/data Address/data Address/data Address/data Port 4 0 to 7 0 Port Port Address Address Address Port Port 1 2 Port 5 3 4 5 6 7 4 Port RD, WR, WAIT, ASTB RD, WR, WAIT, ASTB RD, WR, WAIT, ASTB RD, WR, WAIT, ASTB 5 Port 6 6 7
Caution
When the external wait function is not used, the WAIT pin can be used as a port in all modes.
416
User's Manual U14260EJ3V1UD
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
The memory maps when the external device expansion function is used are as follows. Figure 20-1. Memory Map When Using External Device Expansion Function (a) Memory map of PD780076, 780076Y, and of (b) Memory map of PD780078, 780078Y and of
PD78F0078, 78F0078Y when flash memory size
is 48 KB
FFFFH SFR FF00H FEFFH Internal high-speed RAM FB00H FAFFH Reserved F800H F7FFH
PD78F0078, 78F0078Y when flash memory size
is 60 KB
FFFFH SFR FF00H FEFFH Internal high-speed RAM FB00H FAFFH Reserved F800H F7FFH
Internal expansion RAM
Internal expansion RAM
F400H F3FFH
F400H F3FFH
Full-address mode (when MM2 to MM0 = 111) or 16 KB expansion mode (when MM2 to MM0 = 101)
Full-address mode (when MM2 to MM0 = 111) or 16 KB expansion mode (when MM2 to MM0 = 101) or 4 KB expansion mode (when MM2 to MM0 = 100)
D000H CFFFH 4 KB expansion mode (when MM2 to MM0 = 100) C100H C0FFH C000H BFFFH F100H F0FFH F000H EFFFH 256-byte expansion mode (when MM2 to MM0 = 011)
256-byte expansion mode (when MM2 to MM0 = 011)
Single-chip mode Single-chip mode
0000H
0000H
User's Manual U14260EJ3V1UD
417
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
20.2 External Device Expansion Function Control Registers
The external device expansion function is controlled by the following two registers. * * Memory expansion mode register (MEM) Memory expansion wait setting register (MM)
(1) Memory expansion mode register (MEM) MEM sets the external expansion area. MEM is set by a 1-bit or 8-bit memory manipulation instruction. RESET input clears MEM to 00H. Figure 20-2. Format of Memory Expansion Mode Register (MEM)
Address: FF47H After reset: 00H R/W Symbol MEM 7 0 6 0 5 0 4 0 3 0 2 MM2 1 MM1 0 MM0
MM2 0 0
MM1 0 0
MM0 0 1
Single-Chip/Memory
P40 to P47, P50 to P57, P64 to P67 Pin State
Expansion Mode Selection P40 to P47 P50 to P53 P54, P55 P56, P57 P64 to P67 Single-chip mode Port 4 falling edge detection mode Memory 256-byte expansion mode modeNote 4 KB mode 16 KB mode Full-address mode Setting prohibited AD0 to AD7 Port mode P64 = RD P65 = WR P66 =WAIT P67 = ASTB Port mode
0
1
1
1
0
0
A8 to A11 Port mode
1
0
1
A12, A13 Port mode
1
1
1
A14, A15
Other than above
Caution
When using the falling edge detection function of port 4, be sure to set MEM to 01H.
(Note is shown in the next page.)
418
User's Manual U14260EJ3V1UD
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Note When the CPU accesses the external memory expansion area, the lower bits of the address to be accessed are output to the specified pins (except in the full-address mode). Figure 20-3. Pins Specified for Address (with PD780076 and 780076Y)
External Expansion Mode Address Accessed by CPU 256-byte expansion mode C000H C001H C055H C0FEH C0FFH 4 KB expansion mode C000H C001H C100H CFFFH 16 KB expansion mode C000H D000H E000H F000H F3FFH Full-address mode C000H C001H F3FFH Pins Specified for Address A15 A14 A13 A12 A11 A10 A9 A8 AD7 AD6 AD5 AD4 AD3 AD2 AD1 AD0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 0 0 1 0 1 1 0 1 0 1 0 1 0 0 0 0 1 0 1 1
(1) (1) (0) (0) (0) (0) (0) (0) (1) (1) (0) (0) (0) (0) (0) (0) (1) (1) (0) (0) (0) (0) (0) (0) (1) (1) (0) (0) (0) (0) (0) (0) (1) (1) (0) (0) (0) (0) (0) (0) (1) (1) (0) (0) (1) (1) (0) (0) (1) (1) (0) (0) (1) (1) (0) (0) (1) (1) (1) (1) (1) (1) (1) (1) (1) (1) 1 1 1 1 1 1 0 0 1 1 1 0 0 1 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0 0 1 1 0 0 0 0 1 0 0 1
Remark
The value in ( ) is not actually output. This pin can be used as a port pin.
(2) Memory expansion wait setting register (MM) MM sets the number of waits. MM is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets MM to 10H. Figure 20-4. Format of Memory Expansion Wait Setting Register (MM)
Address: FFF8H After reset: 10H R/W Symbol MM 7 0 6 0 5 PW1 4 PW0 3 0 2 0 1 0 0 0
PW1 0 0 1 1
PW0 0 1 0 1 No wait Wait (one wait state inserted) Setting prohibited
Wait control
Wait control by external wait pin
Cautions 1. 2.
To control wait by the external wait pin, be sure to set the WAIT/P66 pin to input mode (set bit 6 (PM66) of port mode register 6 (PM6) to 1). When wait is not controlled by the external wait pin, the WAIT/P66 pin can be used as an I/O port pin.
User's Manual U14260EJ3V1UD
419
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
20.3 External Device Expansion Function Timing
The timing control signal output pins in the external memory expansion mode are as follows. (1) RD pin (Alternate function: P64) Read strobe signal output pin. The read strobe signal is output when data is read and instructions are fetched from external memory. During internal memory read, the read strobe signal is not output (maintains high level). (2) WR pin (Alternate function: P65) Write strobe signal output pin. The write strobe signal is output when data is written to external memory. During internal memory write, the write strobe signal is not output (maintains high level). (3) WAIT pin (Alternate function: P66) External wait signal input pin. When the external wait is not used, the WAIT pin can be used as an I/O port pin. During internal memory access, the external wait signal is ignored. (4) ASTB pin (Alternate function: P67) Address strobe signal output pin. The address strobe signal is output regardless of data access and instruction fetch from external memory. During internal memory access, the address strobe signal is output. (5) AD0 to AD7, A8 to A15 pins (Alternate function: P40 to P47, P50 to P57) Address/data signal output pins. A valid signal is output or input during data accesses and instruction fetches from external memory. These signals change even during internal memory access (output values are undefined). The timing charts are shown in Figures 20-5 to 20-8.
420
User's Manual U14260EJ3V1UD
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Figure 20-5. Instruction Fetch from External Memory (a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
AD0 to AD7
Lower address
Instruction code
A8 to A15
Higher address
(b) Wait (PW1, PW0 = 0, 1) setting
ASTB
RD
AD0 to AD7
Lower address
Instruction code
A8 to A15 Internal wait signal (1-clock wait)
Higher address
(c) External wait (PW1, PW0 = 1, 1) setting
ASTB
RD
AD0 to AD7
Lower address
Instruction code
A8 to A15
Higher address
WAIT
User's Manual U14260EJ3V1UD
421
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Figure 20-6. External Memory Read Timing (a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
AD0 to AD7
Lower address
Read data
A8 to A15
Higher address
(b) Wait (PW1, PW0 = 0, 1) setting
ASTB
RD
AD0 to AD7
Lower address
Read data
A8 to A15 Internal wait signal (1-clock wait)
Higher address
(c) External wait (PW1, PW0 = 1, 1) setting
ASTB
RD
AD0 to AD7
Lower address
Read data
A8 to A15
Higher address
WAIT
422
User's Manual U14260EJ3V1UD
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Figure 20-7. External Memory Write Timing (a) No wait (PW1, PW0 = 0, 0) setting
ASTB
WR Hi-Z
AD0 to AD7
Lower address
Write data
A8 to A15
Higher address
(b) Wait (PW1, PW0 = 0, 1) setting
ASTB
WR
Lower address
AD0 to AD7
Hi-Z
Write data
A8 to A15 Internal wait signal (1-clock wait)
Higher address
(c)
External wait (PW1, PW0 = 1, 1) setting
ASTB
WR
Lower address
AD0 to AD7
Hi-Z
Write data
A8 to A15
Higher address
WAIT
User's Manual U14260EJ3V1UD
423
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
Figure 20-8. External Memory Read-Modify-Write Timing (a) No wait (PW1, PW0 = 0, 0) setting
ASTB
RD
WR
Lower address
Hi-Z Read data Write data
AD0 to AD7
A8 to A15
Higher address
(b) Wait (PW1, PW0 = 0, 1) setting
ASTB
RD
WR
Lower address
Hi-Z Read data Write data
AD0 to AD7
A8 to A15 Internal wait signal (1-clock wait)
Higher address
(c) External wait (PW1, PW0 = 1, 1) setting
ASTB
RD
WR
Lower address
Hi-Z Read data Write data
AD0 to AD7
A8 to A15
Higher address
WAIT
Remark The read-modify-write timing is the operation when a bit manipulation instruction is executed.
424
User's Manual U14260EJ3V1UD
CHAPTER 20
EXTERNAL DEVICE EXPANSION FUNCTION
20.4 Example of Connection with Memory
This section provides an example of connecting the PD780078 with the external memory (SRAM) in Figure 209. In addition, the external device expansion function is used in the full-address mode, the addresses from 0000H to EFFFH (60 KB) are allocated to internal ROM, and the addresses after F000H are allocated to SRAM. Figure 20-9. Connection Example of PD780078 and Memory
VDD0
PD780078
RD WR Address bus A8 to A14 74HC573 LE Q0 to Q7 AD0 to AD7 D0 to D7 OE
PD43256B
CS OE WE I/O1 to I/O8 A0 to A14 Data bus
ASTB
User's Manual U14260EJ3V1UD
425
CHAPTER 21
STANDBY FUNCTION
21.1 Standby Function and Configuration
21.1.1 Standby function The standby function is designed to decrease power consumption of the system. The following two modes are available. (1) HALT mode HALT instruction execution sets the HALT mode. The HALT mode stops the CPU operation clock. If the main system clock oscillator or subsystem clock oscillator is operating before the HALT mode is set, oscillation of each clock continues. In this mode, power consumption is not decreased as much as in the STOP mode. However, the HALT mode is effective to restart operation immediately upon an interrupt request and to carry out intermittent operations. (2) STOP mode STOP instruction execution sets the STOP mode. In the STOP mode, the main system clock oscillator stops, stopping the whole system, thereby considerably reducing the CPU power consumption. Data memory low-voltage hold (down to VDD = 1.6 V) is possible. Thus, the STOP mode is effective to hold data memory contents with ultra-low power consumption. Because this mode can be released upon an interrupt request, it enables intermittent operations to be carried out. However, because a wait time is required to stabilize oscillation after the STOP mode is released, select the HALT mode if it is necessary to start processing immediately upon an interrupt request. In either of these two modes, all the contents of registers, flags and data memory just before the standby mode is set are held. The I/O port output latches and output buffer statuses are also held. Cautions 1. The STOP mode can be used only when the system operates with the main system clock (subsystem clock oscillation cannot be stopped). The HALT mode can be used with either the main system clock or the subsystem clock. 2. When operation is transferred to the STOP mode, be sure to stop operation of the peripheral hardware operating with the main system clock before executing the STOP instruction. 3. The following sequence is recommended for reducing the power consumption of the A/D converter when the standby function is used: First clear bit 7 (ADCS0) of A/D converter mode register 0 (ADM0) to 0 to stop the A/D conversion operation, and then execute the HALT or STOP instruction.
426
User's Manual U14260EJ3V1UD
CHAPTER 21
STANDBY FUNCTION
21.1.2 Standby function control register The wait time after the STOP mode is released upon an interrupt request is controlled by the oscillation stabilization time select register (OSTS). OSTS is set by an 8-bit memory manipulation instruction. RESET input sets OSTS to 04H. Therefore, when the STOP mode is released by inputting RESET, it takes 217/ fX until release. Remark For the registers that start, stop, or select the clock, see CHAPTER 7 CLOCK GENERATOR. Figure 21-1. Format of Oscillation Stabilization Time Select Register (OSTS)
Address: FFFAH After reset: 04H R/W Symbol OSTS 7 0 6 0 5 0 4 0 3 0 2 OSTS2 1 OSTS1 0 OSTS0
OSTS2
OSTS1
OSTS0
Selection of Oscillation Stabilization Time fX = 8.38 MHz fX = 12 MHzNote 341 s 1.36 ms 2.73 ms 5.46 ms 10.9 ms
0 0 0 0 1
0 0 1 1 0
0 1 0 1 0
212/fX 214/fX 215/fX 216/fX 217/fX Setting prohibited
488 s 1.95 ms 3.91 ms 7.82 ms 15.6 ms
Other than above
Note Expanded-specification products of PD780078 Subseries only. Caution The wait time after the STOP mode is released does not include the time (see "a" in the illustration below) from STOP mode release to clock oscillation start. This applies regardless of whether STOP mode is released by RESET input or by interrupt request generation.
STOP mode release
X1 pin voltage waveform a
Remark fX: Main system clock oscillation frequency
User's Manual U14260EJ3V1UD
427
CHAPTER 21
STANDBY FUNCTION
21.2 Standby Function Operations
21.2.1 HALT mode (1) HALT mode setting and operating statuses The HALT mode is set by executing the HALT instruction. It can be set with the main system clock or the subsystem clock. The operating statuses in the HALT mode are described below. Table 21-1.
HALT Mode Setting
HALT Mode Operating Statuses
HALT Instruction Execution when Using Subsystem Clock With main system clock oscillation With main system clock oscillation stopped
HALT Instruction Execution when Using Main System Clock Without subsystem clockNote 1 With subsystem clockNote 2
Item
Clock generator CPU
Both main system clock and subsystem clock can be oscillated. Clock supply to CPU stops. Operation stops.
Ports (output latches) Status before HALT mode setting is held. 16-bit timer/event counters 00, 01 8-bit timer/event counters 50, 51 Operable Stop
Operable
Operable when TI50, TI51 are selected as count clock. Operable Operable when fXT is selected as count clock. Operation stops. fX/27 is Operable Operable when fXT is selected as output clock. BUZ is at low level.
Watch timer
Operable when fX/27 is selected as count clock Operable Operable when fX to
Watchdog timer Clock output
selected as output clock Buzzer output A/D converter Serial interface Operable Stop Operable
Operable during external clock input.
External interrupt Bus line during external expansion
Operable
AD0 to AD7 High impedance A8 to A15 Status before HALT mode setting is held. ASTB WR, RD WAIT Low level High level High impedance
Notes 1. Including case when external clock is not supplied. 2. Including case when external clock is supplied.
428
User's Manual U14260EJ3V1UD
CHAPTER 21
STANDBY FUNCTION
(2) HALT mode release The HALT mode can be released by the following three sources. (a) Release by unmasked interrupt request When an unmasked interrupt request is generated, the HALT mode is released. If interrupt acknowledgment is enabled, vectored interrupt servicing is carried out. If interrupt acknowledgment is disabled, the instruction at the next address is executed. Figure 21-2. HALT Mode Release by Interrupt Request Generation
Interrupt request HALT instruction Standby release signal CPU status Operation mode HALT mode Oscillation Wait Operation mode Wait
Clock
Remarks 1. The broken lines indicate the case when the interrupt request that released the standby mode is acknowledged. 2. The wait times are as follows: * When vectored interrupt servicing is carried out: 8 or 9 clocks * When vectored interrupt servicing is not carried out: 2 or 3 clocks (b) Release by non-maskable interrupt request When a non-maskable interrupt request is generated, the HALT mode is released and vectored interrupt servicing is carried out whether interrupt acknowledgment is enabled or disabled. However, a non-maskable interrupt request is not generated during operation with the subsystem clock.
User's Manual U14260EJ3V1UD
429
CHAPTER 21
STANDBY FUNCTION
(c) Release by RESET input When the RESET signal is input, HALT mode is released. And, as in the case with normal reset operation, the program is executed after branch to the reset vector address. Figure 21-3. HALT Mode Release by RESET Input
Wait (217/fX: 15.6 ms)
HALT instruction
RESET signal CPU status Operating mode HALT mode Oscillation Reset period Oscillation stop Oscillation stabilization wait status Oscillation Operating mode
Clock
Remarks 1. fX: Main system clock oscillation frequency 2. Values in parentheses are for operation with fX = 8.38 MHz. Table 21-2.
Release Source Maskable interrupt request
Operation in Response to Interrupt Request in HALT Mode
MKxx 0 0 0 0 0 1 PRxx 0 0 1 1 1 x -- -- IE 0 1 0 x 1 x x x ISP x x 1 0 1 x x x Interrupt servicing execution HALT mode hold Interrupt servicing execution Reset processing Operation Next address instruction execution Interrupt servicing execution Next address instruction execution
Non-maskable interrupt request RESET input
-- --
x: Don't care
430
User's Manual U14260EJ3V1UD
CHAPTER 21
STANDBY FUNCTION
21.2.2 STOP mode (1) STOP mode setting and operating status The STOP mode is set by executing the STOP instruction. It can be set only with the main system clock. Cautions 1. When the STOP mode is set, the X2 pin is internally connected to VDD1 via a pull-up resistor to minimize the leakage current at the crystal oscillator. Thus, do not use the STOP mode in a system where an external clock is used for the main system clock. 2. Because the interrupt request signal is used to clear the standby mode, if there is an interrupt source with the interrupt request flag set and the interrupt mask flag reset, the standby mode is immediately cleared if set. Thus, the STOP mode is reset to the HALT mode immediately after execution of the STOP instruction. The operating mode is set after the wait set using the oscillation stabilization time select register (OSTS). The operating statuses in the STOP mode are described in Table 21-3 below. Table 21-3.
STOP Mode Setting Item Clock generator CPU Ports (output latches) 16-bit timer/event counters 00, 01 8-bit timer/event counters 50, 51 Watch timer With Subsystem Clock Only main system clock oscillation is stopped. Operation stops. Status before STOP mode setting is held. Operation stops. Operable only when TI50, TI51 are selected as count clock. Operable when fXT is selected as count clock. Operation stops. Operable when fXT is selected as output clock. Buzzer output A/D converter Serial interface Other than UART0, 2 UART0, 2 BUZ is at low level. Operation stops. Operable only when externally supplied clock is specified as the serial clock. Operation stops. (Transmit shift register 0, 2 (TXS0, TXS2), receive shift register 0, 2 (RX0, RX2), receive buffer register 0, 2 (RXB0, RXB2) and transmit buffer register 2 (TXB2) hold the value just before the clock stopped.) External interrupt Bus line during external expansion AD0 to AD7 A8 to A15 ASTB WR, RD WAIT Operable High impedance Status before STOP mode setting is held. Low level High level High impedance PCL is at low level. Operation stops. Without Subsystem Clock
STOP Mode Operating Statuses
Watchdog timer Clock output
User's Manual U14260EJ3V1UD
431
CHAPTER 21
STANDBY FUNCTION
(2) STOP mode release The STOP mode can be released by the following two sources. (a) Release by unmasked interrupt request When an unmasked interrupt request is generated, the STOP mode is released. If interrupt acknowledgment is enabled after the lapse of oscillation stabilization time, vectored interrupt service is carried out. If interrupt acknowledgment is disabled, the instruction at the next address is executed. Figure 21-4. STOP Mode Release by Interrupt Request Generation
Interrupt request STOP instruction Standby release signal Operating mode Oscillation STOP mode Oscillation stop Oscillation stabilization wait status Oscillation Operating mode
Wait (Time set by OSTS)
CPU status
Clock
Remark The broken lines indicate the case when the interrupt request that released the standby status is acknowledged.
432
User's Manual U14260EJ3V1UD
CHAPTER 21
STANDBY FUNCTION
(b) Release by RESET input The STOP mode is released when the RESET signal is input, and the reset operation is carried out after the lapse of oscillation stabilization time. Figure 21-5. STOP Mode Release by RESET Input
Wait (217/fX: 15.6 ms)
STOP instruction
RESET signal Operating mode Oscillation STOP mode Oscillation stop Reset period Oscillation stabilization wait status Oscillation Operating mode
CPU status
Clock
Remarks 1. fX: Main system clock oscillation frequency 2. Values in parentheses are for operation with fX = 8.38 MHz. Table 21-4.
Release Source Maskable interrupt request
Operation in Response to Interrupt Request in STOP Mode
MKxx 0 0 0 0 0 1 PRxx 0 0 1 1 1 x -- IE 0 1 0 x 1 x x ISP x x 1 0 1 x x Interrupt servicing execution STOP mode hold Reset processing Operation Next address instruction execution Interrupt servicing execution Next address instruction execution
RESET input
--
x: Don't care
User's Manual U14260EJ3V1UD
433
CHAPTER 22
RESET FUNCTION
22.1 Reset Function
The following two operations are available to generate the reset signal. (1) (2) External reset input via RESET pin Internal reset by watchdog timer program loop time detection
External reset and internal reset have no functional differences. In both cases, program execution starts at the address at 0000H and 0001H by RESET input. When a low level is input to the RESET pin or the watchdog timer overflows, a reset is applied and each hardware is set to the status shown in Table 22-1. Each pin is high impedance during reset input or during the oscillation stabilization time just after reset release. When a high level is input to the RESET pin, the reset is released and program execution starts after the lapse of oscillation stabilization time (217/fX). The reset applied by watchdog timer overflow is automatically released after the reset and program execution starts after the lapse of oscillation stabilization time (217/fX) (see Figures 22-2 to 22-4). Cautions 1. For an external reset, input a low level for 10 s or more to the RESET pin. 2. During reset input, main system clock oscillation remains stopped but subsystem clock oscillation continues. 3. When the STOP mode is released by reset, the STOP mode contents are held during reset input. However, the port pins become high impedance. Figure 22-1. Reset Function Block Diagram
RESET
Reset controller
Reset signal
Count clock
Watchdog timer Stop
Overflow
Interrupt function
434
User's Manual U14260EJ3V1UD
CHAPTER 22
RESET FUNCTION
Figure 22-2. Timing of Reset by RESET Input
X1 Reset period (Oscillation stop) Oscillation stabilization time wait Normal operation (Reset processing)
Normal operation RESET
Internal reset signal Delay Port pin Delay Hi-Z
Figure 22-3. Timing of Reset Due to Watchdog Timer Overflow
X1 Reset period (Oscillation stop) Oscillation stabilization time wait Normal operation (Reset processing)
Normal operation Watchdog timer overflow Internal reset signal
Port pin
Hi-Z
Figure 22-4. Timing of Reset in STOP Mode by RESET Input
X1
STOP instruction execution
Normal operation RESET
Stop status (Oscillation stop)
Reset period (Oscillation stop)
Oscillation stabilization time wait
Normal operation (Reset processing)
Internal reset signal Delay Port pin Delay Hi-Z
User's Manual U14260EJ3V1UD
435
CHAPTER 22
RESET FUNCTION
Table 22-1. Hardware Statuses After Reset Acknowledgment (1/2)
Hardware Status After Reset AcknowledgmentNote 1 Contents of reset vector table (0000H, 0001H) are set. Undefined 02H Data memory General-purpose registers Port registers 0 to 8 (P0 to P8) (output latches) Port mode registers 0, 2 to 8 (PM0, PM2 to PM8) Pull-up resistor option registers 0, 2 to 8 (PU0, PU2 to PU8) Processor clock control register (PCC) Memory size switching register (IMS) Internal expansion RAM size switching register (IXS) Memory expansion mode register (MEM) Memory expansion wait setting register (MM) Oscillation stabilization time select register (OSTS) 16-bit timer/event counters 00, 01 Timer counters 00, 01 (TM00, TM01) Capture/compare registers 000, 001, 010, 011 (CR000, CR001, CR010, CR011) Prescaler mode registers 00, 01 (PRM00, PRM01) Capture/compare control registers 00, 01 (CRC00, CRC01) Mode control registers 00, 01 (TMC00, TMC01) Output control registers 00, 01 (TOC00, TOC01) 8-bit timer/event counters 50, 51 Timer counters 50, 51 (TM50, TM51) Compare registers 50, 51 (CR50, CR51) Clock select registers 50, 51 (TCL50, TCL51) Mode control registers 50, 51 (TMC50, TMC51) Watch timer Watchdog timer Operation mode register (WTM) Clock select register (WDCS) Mode register (WDTM) UndefinedNote 2 UndefinedNote 2 00H (undefined only for P1) FFH 00H 04H CFHNote 3 0CHNote 4 00H 10H 04H 0000H Undefined
Program counter (PC)
Stack pointer (SP) Program status word (PSW) RAM
00H 00H 00H 00H 00H Undefined 00H 00H 00H 00H 00H
Notes 1. During reset input or oscillation stabilization time wait, only the PC contents among the hardware statuses become undefined. All other hardware statuses remain unchanged after reset. 2. When a reset is executed in the standby mode, the pre-reset status is held even after reset. 3. Although the initial value is CFH, set the following value for each version.
PD780076, 780076Y: PD780078, 780078Y:
CCH CFH
PD78F0078, 78F0078Y: Value for mask ROM versions
4. Although the default value of this register is 0CH, initialize this register to 0AH.
436
User's Manual U14260EJ3V1UD
CHAPTER 22
RESET FUNCTION
Table 22-1. Hardware Statuses After Reset Acknowledgment (2/2)
Hardware Status After Reset Acknowledgment 00H 0000H 00H 00H 00H 00H 00H FFH
Clock output/buzzer output controller A/D converter
Clock output select register (CKS) Conversion result register 0 (ADCR0) Mode register 0 (ADM0) Analog input channel specification register 0 (ADS0)
Serial interface UART0
Asynchronous serial interface mode register 0 (ASIM0) Asynchronous serial interface status register 0 (ASIS0) Baud rate generator control register 0 (BRGC0) Transmit shift register 0 (TXS0) Receive buffer register 0 (RXB0)
Serial interface UART2
Asynchronous serial interface mode register 2 (ASIM2) Transfer mode specification register 2 (TRMC2) Clock select register 2 (CKSEL2) Baud rate generator control register 2 (BRGC2) Asynchronous serial interface status register 2 (ASIS2) Asynchronous serial interface transmit status register 2 (ASIF2) Transmit buffer register 2 (TXB2) Receive buffer register 2 (RXB2)
00H 02H 00H 00H 00H 00H FFH FFH Undefined 00H Undefined Undefined 00H 10H 00H 00H 00H 00H 00H 00H FFH FFH 00H 00H
Serial interface SIO3
Shift register 3 (SIO3) Operation mode register 3 (CSIM3)
Serial interface CSI1
Transmit buffer register 1 (SOTB1) Shift register 1(SIO1) Operation mode register 1 (CSIM1) Clock select register 1 (CSIC1)
Serial interface IIC0Note
Transfer clock select register 0 (IICCL0) Shift register 0 (IIC0) Control register 0 (IICC0) Status register 0 (IICS0) Slave address register 0 (SVA0)
Interrupt
Request flag registers (IF0L, IF0H, IF1L) Mask flag registers (MK0L, MK0H, MK1L) Priority specification flag registers (PR0L, PR0H, PR1L) External interrupt rising edge enable register (EGP) External interrupt falling edge enable register (EGN)
Note
Provided only in the PD780078Y Subseries.
User's Manual U14260EJ3V1UD
437
CHAPTER 23 PD78F0078, 78F0078Y
The PD78F0078 and 78F0078Y are provided as the flash memory versions of the PD780078, 780078Y Subseries. The PD78F0078 and 78F0078Y are products that incorporate flash memory in which the program can be written, erased, and rewritten while it is mounted on the board. Writing to flash memory can be performed with the memory mounted on the target system (on board). A dedicated flash programmer is connected to the target system to perform writing. The following can be considered as the development environment and the applications using flash memory.
* * *
Software can be altered after the PD78F0078 and 78F0078Y are solder-mounted on the target system. Small scale production of various models is made easier by differentiating software. Data adjustment in starting mass production is made easier.
Table 23-1 shows the differences between the PD78F0078 and 78F0078Y and the mask ROM versions. Table 23-1. Differences Between PD78F0078 and Mask ROM Versions
Item Internal ROM configuration Internal ROM capacity Mask option to specify on-chip pull-up resistors of pins P30 to P33Note 2 IC pin VPP pin Electrical specifications, recommended soldering conditions
PD78F0078
Flash memory 60 KBNote 1 Not possible
PD780076
Mask ROM 48 KB Possible 60 KB
PD780078
None Available
Available None
Refer to the chapters of electrical specifications and recommended soldering conditions.
Notes 1. The same capacity as the mask ROM versions can be specified by means of the memory size switching register (IMS). 2. The P30 and P31 pins are provided only in the PD780078Y Subseries. Caution There are differences in noise immunity and noise radiation between the flash memory and mask ROM versions. When pre-producing an application set with the flash memory version and then mass-producing it with the mask ROM version, be sure to conduct sufficient evaluations for the commercial samples (not engineering samples) of the mask ROM versions.
438
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
23.1 Memory Size Switching Register
The PD78F0078 and 78F0078Y allow users to select the internal memory capacity using the memory size switching register (IMS) so that the same memory map as that of mask ROM versions with a different internal memory capacity can be achieved. IMS is set by an 8-bit memory manipulation instruction. RESET input sets IMS to CFH. Caution Be sure to set the values of the target mask ROM version as the initial setting of the program. Reset input initializes IMS to CFH. Also be sure to set the values of the target mask ROM version after reset. Figure 23-1. Format of Memory Size Switching Register (IMS)
Address: FFF0H After reset: CFH R/W Symbol IMS 7 RAM2 6 RAM1 5 RAM0 4 0 3 ROM3 2 ROM2 1 ROM1 0 ROM0
RAM2 1
RAM1 1
RAM0 0
Internal high-speed RAM capacity selection 1024 bytes Setting prohibited
Other than above
ROM3 1 1
ROM2 1 1
ROM1 0 1
ROM0 0 1 48 KB 60 KB
Internal ROM capacity selection
Other than above
Setting prohibited
The IMS settings to obtain the same memory map as mask ROM versions are shown in Table 23-2. Table 23-2. Memory Size Switching Register Settings
Target Mask ROM Versions IMS Setting CCH CFH
PD780076, 780076Y PD780078, 780078Y
Caution
When using the mask ROM versions, be sure to set IMS to the value indicated in Table 23-2.
User's Manual U14260EJ3V1UD
439
CHAPTER 23
PD78F0078, 78F0078Y
23.2 Internal Expansion RAM Size Switching Register
The internal expansion RAM size switching register (IXS) is used to set the internal expansion RAM capacity. IXS is set by an 8-bit memory manipulation instruction. RESET input sets IXS to 0CH. Caution Be sure to set IXS to 0AH as the initial setting of the program. Reset input initializes IXS to 0CH, so be sure to set IXS to 0AH after reset. Set the mask ROM versions in the same manner. Figure 23-2. Format of Internal Expansion RAM Size Switching Register (IXS)
Address: FFF4H After reset: 0CH R/W Symbol IXS 7 0 6 0 5 0 4 IXRAM4 3 IXRAM3 2 IXRAM2 1 IXRAM1 0 IXRAM0
IXRAM4 0
IXRAM3 1
IXRAM2 0
IXRAM1 1
IXRAM0 0
Internal expansion RAM capacity selection 1024 bytes Setting prohibited
Other than above
440
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
23.3 Flash Memory Characteristics
Flash memory programming is performed by connecting a dedicated flash programmer (Flashpro III (part no. FLPR3, PG-FP3)/Flashpro IV (part no. FL-PR4, PG-FP4)) to the target system with the flash memory mounted on the target system (on-board). A flash memory writing adapter (program adapter), which is a target board used exclusively for programming, is also provided. Remark FL-PR3, FL-PR4, and the program adapter are products made by Naito Densei Machida Mfg. Co., Ltd. (TEL +81-45-475-4191). Programming using flash memory has the following advantages.
* * *
Software can be modified after the microcontroller is solder-mounted on the target system. Distinguishing software facilities low-quantity, varied model production Easy data adjustment when starting mass production
23.3.1 Programming environment The following shows the environment required for PD78F0078, 78F0078Y flash memory programming. When Flashpro III or Flashpro IV is used as a dedicated flash programmer, a host machine is required to control the dedicated flash programmer. Communication between the host machine and flash programmer is performed via RS-232C/USB (Rev. 1.1). For details, refer to the manuals of Flashpro III/Flashpro IV. Remark USB is supported by Flashpro IV only. Figure 23-3. Environment for Writing Program to Flash Memory
VPP
XXXX YYYY
RS-232C USB
Bxxxxx Cxxxxxx
XXXX
XXXXXX
Axxxx
VDD VSS RESET
XXX YYY
PG-FP4 (Flash Pro4)
XXXXX
STATVE
Dedicated flash programmer SIO/UART/IICNote
PD78F0078, PD78F0078Y
Host machine
Note IIC is supported by the PD78F0078Y only.
User's Manual U14260EJ3V1UD
441
CHAPTER 23
PD78F0078, 78F0078Y
23.3.2 Communication mode Use the communication mode shown in Table 23-3 to perform communication between the dedicated flash programmer and the PD78F0078, 78F0078Y. Table 23-3. Communication Mode List
Communication Mode Port (COMM PORT) Standard (TYPE) SettingNote 1 Speed (SIO CLOCK) On Target Frequency (CPU CLOCK) (Flashpro Clock) Multiply Rate (Multiple Rate) SI3/P34 SO3/P35 SCK3/P36 3-wire serial I/O (SIO3) with handshake SIO-H/S (SIO ch-3 + handshake) SI3/P34 SO3/P35 SCK3/P36 P31 (HS) I2C busNote 3 (IIC0) UART (UART0) IIC-ch0 (IIC ch-0) UART-ch0 (UART ch-0) 10 k to 100 k BaudNote 2 Optional (50 kHz) 4800 to 76800 (4800 to 76800 BaudNotes 2, 4 bps)Notes 2, 4 Optional 1 to 10 MHzNote 2 1.0 1 to 10 MHzNote 2 1.0 SDA0/P32 SCL0/P33 RXD0/P23 TXD0/P24 8 4 3 Pins Used Number of VPP Pulses
3-wire serial I/O (SIO3)
SIO-ch1 (SIO ch-1)
2.4 kHz to 625 kHzNote 2 Optional (100 Hz to 1.25 MHz)Note 2
1 to 10 MHzNote 2 1.0
1
Notes 1. Selection items for Standard settings on Flashpro IV (TYPE settings on Flashpro III). 2. The possible setting range differs depending on the voltage. For details, refer to CHAPTERS 25 to 27. 3. PD78F0078Y only 4. Because factors other than the baud rate error, such as the signal waveform slew, also affect UART communication, thoroughly evaluate the slew as well as the baud rate error. Remark Items enclosed in parentheses in the setting item column are the set value and set item of Flashpro III when they differ from those of Flashpro IV. Figure 23-4. Communication Mode Selection Format
VPP pulse 10 V VPP VDD VSS VDD RESET VSS Flash memory write mode
442
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
Figure 23-5. Example of Connection with Dedicated Flash Programmer (1/2) (a) 3-wire serial I/O (SIO3)
Dedicated flash programmer VPP VDD /RESET SCK SO/TxD SI/RxD CLK GND
PD78F0078, 78F0078Y
VPP VDD0Note 1, VDD1Note 1, AVREF RESET SCK3 SI3 SO3 X1Note 2 VSS0, VSS1, AVSS
(b) 3-wire serial I/O (SIO3) with handshake
Dedicated flash programmer VPP VDD /RESET SCK SO/TxD SI/RxD H/S CLK GND
PD78F0078, 78F0078Y
VPP VDD0Note 1, VDD1Note 1, AVREF RESET SCK3 SI3 SO3 P31 (HS) X1Note 2 VSS0, VSS1, AVSS
(c) UART (UART0)
Dedicated flash programmer VPP VDD /RESET SO/TXD SI/RXD CLK GND
PD78F0078, 78F0078Y
VPP VDD0Note 1, VDD1Note 1, AVREF RESET RXD0 TXD0 X1Note 2 VSS0, VSS1, AVSS
Notes 1. Even if power is supplied on board, the VDD0 and VDD1 pins must be connected to VDD of the dedicated flash programmer. Supply the VDD voltage before programming is started. 2. The X1 pin can be supplied on board. In this case, the pin does not need to be connected to the dedicated flash programmer.
User's Manual U14260EJ3V1UD
443
CHAPTER 23
PD78F0078, 78F0078Y
Figure 23-5. Example of Connection with Dedicated Flash Programmer (2/2) (d) I2C bus (IIC0)
Dedicated flash programmer VPP VDD /RESET SCK SI/RxD CLK GND
PD78F0078, 78F0078Y
VPP VDD0Note 1, VDD1Note 1, AVREF RESET SCL0 SDA0 X1Note 2 VSS0, VSS1, AVSS
Notes 1. Even if power is supplied on board, the VDD0 and VDD1 pins must be connected to VDD of the dedicated flash programmer. Supply the VDD voltage before programming is started. 2. The X1 pin can be supplied on board. In this case, the pin does not need to be connected to the dedicated flash programmer. If Flashpro III/Flashpro IV is used as the dedicated flash programmer, the following signals are generated for the
PD78F0078, 78F0078Y. For details, refer to the manual of Flashpro III/Flashpro IV.
Table 23-4. Pin Connection List
Signal Name VPP VDD I/O Output I/O Pin Function Write voltage VPP
Note 2 Note 2 Note 2 Note 2
Pin Name
SIO3
SIO3 (HS)
UART0
IIC0Note 1
VDD voltage generation/voltage VDD0, VDD1, AVREF monitoring - Ground Clock output Reset signal Reception signal Transmission signal Transfer clock Handshake signal VSS0, VSS1, AVSS X1 RESET SO3/TxD0/SDA0Note 1 SI3/RxD0 SCK3/SCL0Note 1 P31 (HS)
GND CLK /RESET SI/RXD SO/TXD SCK H/S
Output Output Input Output Output Input
x x x x x
Notes 1. PD78F0078Y only 2. VDD voltage must be supplied before programming is started. Remark : Pin must be connected. : If the signal is supplied on the target board, pin does not need to be connected.
x : Pin does not need to be connected.
444
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
23.3.3 On-board pin processing When performing programming on the target system, provide a connector on the target system to connect the dedicated flash programmer. An on-board function that allows switching between normal operation mode and flash memory programming mode may be required in some cases. In normal operation mode, input 0 V to the VPP pin. In flash memory programming mode, a write voltage of 10.0 V (TYP.) is supplied to the VPP pin, so perform the following. (1) Connect a pull-down resistor (RVPP = 10 k) to the VPP pin. (2) Use the jumper on the board to switch the VPP pin input to either the programmer or directly to GND. A VPP pin connection example is shown below. Figure 23-6. VPP Pin Connection Example
PD78F0078, 78F0078Y
Connection pin of dedicated flash programmer VPP
Pull-down resistor (RVPP)
The following shows the pins used by the serial interface.
Serial Interface 3-wire serial I/O (SIO3) 3-wire serial I/O (SIO3) with handshake UART (UART0) I 2C bus (IIC0)Note Pins Used SI3, SO3, SCK3 SI3, SO3, SCK3, P31 (HS) RXD0, TXD0 SDA0, SCL0
Note PD78F0078Y only When connecting the dedicated flash programmer to a serial interface pin that is connected to another device on-board, signal conflict or abnormal operation of the other device may occur. Care must therefore be taken with such connections.
User's Manual U14260EJ3V1UD
445
CHAPTER 23
PD78F0078, 78F0078Y
(1) Signal conflict If the dedicated flash programmer (output) is connected to a serial interface pin (input) that is connected to another device (output), a signal conflict occurs. To prevent this, isolate the connection with the other device or set the other device to the output high impedance status. Figure 23-7. Signal Conflict (Input Pin of Serial Interface)
PD78F0078, 78F0078Y
Signal conflict Input pin Other device Output pin Connection pin of dedicated flash programmer
In the flash memory programming mode, the signal output by another device and the signal sent by the dedicated flash programmer conflict, therefore, isolate the signal of the other device.
(2) Abnormal operation of other device If the dedicated flash programmer (output or input) is connected to a serial interface pin (input or output) that is connected to another device (input), a signal is output to the device, which may cause an abnormal operation. To prevent this abnormal operation, isolate the connection with the other device or set so that the input signals to the other device are ignored. Figure 23-8. Abnormal Operation of Other Device
PD78F0078, 78F0078Y
Connection pin of dedicated flash programmer Pin Other device Input pin
If the signal output by the PD78F0078, 78F0078Y affects another device in the flash memory programming mode, isolate the signals of the other device.
PD78F0078, 78F0078Y
Connection pin of dedicated flash programmer Pin Other device Input pin
If the signal output by the dedicated flash programmer affects another device in the flash memory programming mode, isolate the signals of the other device.
446
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
If the reset signal of the dedicated flash programmer is connected to the RESET pin connected to the reset signal generator on-board, a signal conflict occurs. To prevent this, isolate the connection with the reset signal generator. If the reset signal is input from the user system in the flash memory programming mode, a normal programming operation cannot be performed. Therefore, do not input reset signals from other than the dedicated flash programmer. Figure 23-9. Signal Conflict (RESET Pin)
PD78F0078, 78F0078Y
Signal conflict RESET Reset signal generator Output pin Connection pin of dedicated flash programmer
The signal output by the reset signal generator and the signal output from the dedicated flash programmer conflict in the flash memory programming mode, so isolate the signal of the reset signal generator.
When the PD78F0078 and 78F0078Y enter the flash memory programming mode, all the pins other than those that communicate with the flash programmer are in the same status as immediately after reset. If the external device does not recognize initial statuses such as the output high impedance status, therefore, connect the external device to VDD0 or VSS0 via a resistor. When using the on-board clock, connect X1, X2, XT1, and XT2 as required in the normal operation mode. When using the clock output of the flash programmer, connect it directly to X1, disconnecting the main oscillator on-board, and leave the X2 pin open. The subsystem clock conforms to the normal operation mode. To use the power output from the flash programmer, connect the VDD0 and VDD1 pins to VDD of the flash programmer, and the VSS0 and VSS1 pins to GND of the flash programmer. To use the on-board power supply, make connections that accord with the normal operation mode. However, because the voltage is monitored by the flash programmer, be sure to connect the VDD0, VDD1, VSS0, and VSS1 pins to VDD and GND of the flash programmer. Supply the same power as in the normal operation mode to the other power supply pins (AVREF and AVSS).
User's Manual U14260EJ3V1UD
447
CHAPTER 23
PD78F0078, 78F0078Y
23.3.4 Connection of adapter for flash writing The following shows the recommended connection example when the adapter for flash writing is used. Figure 23-10. Wiring Example for Adapter for Flash Writing with 3-Wire Serial I/O (SIO3)
VDD (2.7 to 5.5 V) GND
LVDD (VPP2) VDD GND 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
SI
SO
SCK
CLK
/RESET VPP RESERVE/HS
WRITER INTERFACE
448
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
Figure 23-11. Wiring Example for Adapter for Flash Writing with 3-Wire Serial I/O (SIO3) with Handshake
VDD (2.7 to 5.5 V) GND
LVDD (VPP2) VDD GND 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
SI
SO
SCK
CLK
/RESET VPP RESERVE/HS
WRITER INTERFACE
User's Manual U14260EJ3V1UD
449
CHAPTER 23
PD78F0078, 78F0078Y
Figure 23-12. Wiring Example for Adapter for Flash Writing with UART (UART0)
VDD (2.7 to 5.5 V) GND
LVDD (VPP2) VDD GND 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
SI
SO
SCK
CLK
/RESET VPP RESERVE/HS
WRITER INTERFACE
450
User's Manual U14260EJ3V1UD
CHAPTER 23
PD78F0078, 78F0078Y
Figure 23-13. Wiring Example for Adapter for Flash Writing with I2C Bus (IIC0) (PD78F0078Y Only)
VDD (2.7 to 5.5 V) GND
LVDD (VPP2) VDD GND 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33
SI
SO
SCK
CLK
/RESET VPP RESERVE/HS
WRITER INTERFACE
User's Manual U14260EJ3V1UD
451
CHAPTER 24
INSTRUCTION SET
This chapter lists each instruction set of the PD780078, 780078Y Subseries in table form. For details of the operation and operation code of each instruction, refer to the separate document 78K/0 Series Instructions User's Manual (U12326E).
452
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
24.1 Legend Used in Operation List
24.1.1 Operand identifiers and specification methods Operands are written in the "Operand" column of each instruction in accordance with the specification method of the instruction operand identifier (refer to the assembler specifications for details). When there are two or more methods, select one of them. Uppercase letters and the symbols #, !, $ and [ ] are keywords and must be written as they are. Each symbol has the following meaning. * #: * !: * $: Immediate data specification Absolute address specification Relative address specification
* [ ]: Indirect address specification In the case of immediate data, describe an appropriate numeric value or a label. When using a label, be sure to write the #, !, $, and [ ] symbols. For operand register identifiers, r and rp, either function names (X, A, C, etc.) or absolute names (names in parentheses in the table below, R0, R1, R2, etc.) can be used for specification. Table 24-1. Operand Identifiers and Specification Methods
Identifier r rp sfr sfrp saddr saddrp addr16 addr11 addr5 word byte bit RBn Specification Method X (R0), A (R1), C (R2), B (R3), E (R4), D (R5), L (R6), H (R7) AX (RP0), BC (RP1), DE (RP2), HL (RP3) Special function register symbolNote Special function register symbol (16-bit manipulatable register, even addresses only)Note FE20H to FF1FH Immediate data or labels FE20H to FF1FH Immediate data or labels (even address only) 0000H to FFFFH Immediate data or labels (Only even addresses for 16-bit data transfer instructions) 0800H to 0FFFH Immediate data or labels 0040H to 007FH Immediate data or labels (even address only) 16-bit immediate data or label 8-bit immediate data or label 3-bit immediate data or label RB0 to RB3
Note Addresses from FFD0H to FFDFH cannot be accessed with these operands. Remark For special function register symbols, refer to Table 5-3 Special Function Register List.
User's Manual U14260EJ3V1UD
453
CHAPTER 24
INSTRUCTION SET
24.1.2 Description of "operation" column A: X: B: C: D: E: H: L: AX: BC: DE: HL: PC: SP: PSW: CY: AC: Z: RBS: IE: ( ): : : : : A register; 8-bit accumulator X register B register C register D register E register H register L register AX register pair; 16-bit accumulator BC register pair DE register pair HL register pair Program counter Stack pointer Program status word Carry flag Auxiliary carry flag Zero flag Register bank select flag Interrupt request enable flag Memory contents indicated by address or register contents in parentheses Logical product (AND) Logical sum (OR) Exclusive logical sum (exclusive OR) Inverted data
XH, XL: Higher 8 bits and lower 8 bits of 16-bit register
addr16: 16-bit immediate data or label jdisp8: Signed 8-bit data (displacement value) 24.1.3 Description of "flag operation" column (Blank): Not affected 0: 1: x: R: Cleared to 0 Set to 1 Set/cleared according to the result Previously saved value is restored
454
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
24.2 Operation List
Instruction Mnemonic Group 8-bit data transfer MOV Clocks Operands r, #byte saddr, #byte sfr, #byte A, r r, A A, saddr saddr, A A, sfr sfr, A A, !addr16 !addr16, A PSW, #byte A, PSW PSW, A A, [DE] [DE], A A, [HL] [HL], A A, [HL + byte] [HL + byte], A A, [HL + B] [HL + B], A A, [HL + C] [HL + C], A XCH A, r A, saddr A, sfr A, !addr16 A, [DE] A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 3 Note 3 Note 3
Flag Operation Z AC CY r byte (saddr) byte sfr byte Ar rA A (saddr) (saddr) A A sfr sfr A A (addr16) (addr16) A PSW byte A PSW PSW A A (DE) (DE) A A (HL) (HL) A A (HL + byte) (HL + byte) A A (HL + B) (HL + B) A A (HL + C) (HL + C) A Ar A (saddr) A (sfr) A (DE) A (HL) x x x x x x
Bytes
Note 1 Note 2
2 3 3 1 1 2 2 2 2 3 3 3 2 2 1 1 1 1 2 2 1 1 1 1 1 2 2 3 1 1 2 2 2
4 6 - 2 2 4 4 - - 8 8 - - - 4 4 4 4 8 8 6 6 6 6 2 4 - 8 4 4 8 8 8
- 7 7 - - 5 5 5 5 9+n 9+m 7 5 5 5+n 5+m 5+n 5+m 9+n 9+m 7+n 7+m 7+n 7+m - 6 6
10 + n + m A (addr16) 6+n+m 6+n+m
10 + n + m A (HL + byte) 10 + n + m A (HL + B) 10 + n + m A (HL + C)
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed. 3. Except "r = A" Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from. 4. m is the number of waits when external memory expansion area is written to.
User's Manual U14260EJ3V1UD
455
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group 16-bit data transfer MOVW
Clocks Operands rp, #word saddrp, #word sfrp, #word AX, saddrp saddrp, AX AX, sfrp sfrp, AX AX, rp rp, AX AX, !addr16 !addr16, AX
Note 3 Note 3
Flag Operation Z AC CY rp word (saddrp) word sfrp word AX (saddrp) (saddrp) AX AX sfrp sfrp AX AX rp rp AX
Bytes
Note 1 Note 2
3 4 4 2 2 2 2 1 1 3 3
Note 3
6 8 - 6 6 - - 4 4 10 10 4 4 6 4 4 4 8 4 8 8 8 4 6 4 4 4 8 4 8 8 8
- 10 10 8 8 8 8 - -
12 + 2n AX (addr16) 12 + 2m (addr16) AX - - 8 - - 5 9+n 5+n 9+n 9+n 9+n - 8 - - 5 9+n 5+n 9+n 9+n 9+n AX rp A, CY A + byte (saddr), CY (saddr) + byte A, CY A + r r, CY r + A A, CY A + (saddr) A, CY A + (addr16) A, CY A + (HL) A, CY A + (HL + byte) A, CY A + (HL + B) A, CY A + (HL + C) A, CY A + byte + CY (saddr), CY (saddr) + byte + CY A, CY A + r + CY r, CY r + A + CY A, CY A + (saddr) + CY A, CY A + (addr16) + CY A, CY A + (HL) + CY A, CY A + (HL + byte) + CY A, CY A + (HL + B) + CY A, CY A + (HL + C) + CY x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
XCHW 8-bit operation ADD
AX, rp A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
1 2 3
Note 4
2 2 2 3 1 2 2 2 2 3
ADDC
A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 4
2 2 2 3 1 2 2 2
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed 3. Only when rp = BC, DE or HL 4. Except "r = A" Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from. 4. m is the number of waits when external memory expansion area is written to.
456
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group 8-bit operation SUB
Clocks Operands A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 3
Flag Operation Z AC CY x x x x x x x x x x x x x x x x x x x x x byte x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
Bytes
Note 1 Note 2
2 3 2 2 2 3 1 2 2 2 2 3
Note 3
4 6 4 4 4 8 4 8 8 8 4 6 4 4 4 8 4 8 8 8 4 6 4 4 4 8 4 8 8 8
- 8 - - 5 9+n 5+n 9+n 9+n 9+n - 8 - - 5 9+n 5+n 9+n 9+n 9+n - 8 - - 5 9+n 5+n 9+n 9+n 9+n
A, CY A - byte (saddr), CY (saddr) - byte A, CY A - r r, CY r - A A, CY A - (saddr) A, CY A - (addr16) A, CY A - (HL) A, CY A - (HL + byte) A, CY A - (HL + B) A, CY A - (HL + C) A, CY A - byte - CY (saddr), CY (saddr) - byte - CY A, CY A - r - CY r, CY r - A - CY A, CY A - (saddr) - CY A, CY A - (addr16) - CY A, CY A - (HL) - CY A, CY A - (HL + byte) - CY A, CY A - (HL + B) - CY A, CY A - (HL + C) - CY AA AA rr AA AA AA AA AA AA byte (saddr) (saddr) r A (saddr) (addr16) (HL) (HL + byte) (HL + B) (HL + C)
SUBC
A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
2 2 2 3 1 2 2 2 2 3
AND
A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 3
2 2 2 3 1 2 2 2
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed 3. Except "r = A" Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from.
User's Manual U14260EJ3V1UD
457
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group 8-bit operation OR
Clocks Operands A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 3
Flag Operation Z AC CY x x x x x x x x x x x byte x x x (saddr) (addr16) (HL) (HL + byte) (HL + B) (HL + C) x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
Bytes
Note 1 Note 2
2 3 2 2 2 3 1 2 2 2 2 3
Note 3
4 6 4 4 4 8 4 8 8 8 4 6 4 4 4 8 4 8 8 8 4 6 4 4 4 8 4 8 8 8
- 8 - - 5 9+n 5+n 9+n 9+n 9+n - 8 - - 5 9+n 5+n 9+n 9+n 9+n - 8 - - 5 9+n 5+n 9+n 9+n 9+n
A A byte (saddr) (saddr) byte AA r rr A A A (saddr) A A (addr16) A A (HL) A A (HL + byte) A A (HL + B) A A (HL + C) AA AA rr AA AA AA AA AA AA A - byte (saddr) - byte A-r r-A A - (saddr) A - (addr16) A - (HL) A - (HL + byte) A - (HL + B) A - (HL + C) A byte (saddr) (saddr) r
XOR
A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
2 2 2 3 1 2 2 2 2 3
CMP
A, #byte saddr, #byte A, r r, A A, saddr A, !addr16 A, [HL] A, [HL + byte] A, [HL + B] A, [HL + C]
Note 3
2 2 2 3 1 2 2 2
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed 3. Except "r = A" Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from.
458
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group 16-bit operation ADDW SUBW CMPW Multiply/ divide MULU DIVUW
Clocks Operands AX, #word AX, #word AX, #word X C r saddr r saddr Bytes
Note 1 Note 2
Flag Operation Z AC CY AX, CY AX + word AX, CY AX - word AX - word AX A x X AX (Quotient), C (Remainder) AX / C rr+1 (saddr) (saddr) + 1 rr-1 (saddr) (saddr) - 1 rp rp + 1 rp rp - 1 (CY, A7 A0, Am - 1 Am) x 1 time (CY, A0 A7, Am + 1 Am) x 1 time (CY A0, A7 CY, Am - 1 Am) x 1 time (CY A7, A0 CY, Am + 1 Am) x 1 time (HL)3 - 0 (HL)7 - 4 x x x x x x x x x x x x x x x x x x x x x
3 3 3 2 2 1 2 1 2 1 1 1 1 1 1 2 2 2 2
6 6 6 16 25 2 4 2 4 4 4 2 2 2 2 10 10 4 4 6 - 4 - 6 6 - 4 - 6
- - - - - - 6 - 6 - - - - - -
Increment/ INC decrement DEC
INCW DECW Rotate ROR ROL RORC ROLC ROR4 ROL4 BCD adjust ADJBA ADJBS Bit manipulate MOV1
rp rp A, 1 A, 1 A, 1 A, 1 [HL] [HL]
12 + n + m A3 - 0 (HL)3 - 0, (HL)7 - 4 A3 - 0, 12 + n + m A3 - 0 (HL)7 - 4, (HL)3 - 0 A3 - 0,
(HL)7 - 4 (HL)3 - 0 - - 7 7 - 7 7+n 8 8 - 8
8+n+m
Decimal Adjust Accumulator after Addition Decimal Adjust Accumulator after Subtract CY (saddr.bit) CY sfr.bit CY A.bit CY PSW.bit CY (HL).bit (saddr.bit) CY sfr.bit CY A.bit CY PSW.bit CY (HL).bit CY
x x
x x
x x x x x x x
CY, saddr.bit CY, sfr.bit CY, A.bit CY, PSW.bit CY, [HL].bit saddr.bit, CY sfr.bit, CY A.bit, CY PSW.bit, CY [HL].bit, CY
3 3 2 3 2 3 3 2 3 2
x
x
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from. 4. m is the number of waits when external memory expansion area is written to.
User's Manual U14260EJ3V1UD
459
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group Bit manipulate AND1
Operands CY, saddr.bit CY, sfr.bit CY, A.bit CY, PSW.bit CY, [HL].bit
Bytes 3 3 2 3 2 3 3 2 3 2 3 3 2 3 2 2 3 2 2 2 2 3 2 2 2 1 1 1 6 - 4 - 6 6 - 4 - 6 6 - 4 - 6 4 - 4 - 6 4 - 4 - 6 2 2 2
Clocks
Note 1 Note 2
Operation CY CY CY CY CY CY CY CY CY CY (saddr.bit) sfr.bit A.bit PSW.bit (HL).bit
Flag Z AC CY x x x x x x x x x x x x x x x
7 7 - 7 7+n 7 7 - 7 7+n 7 7 - 7 7+n 6 8 - 6
OR1
CY, saddr.bit CY, sfr.bit CY, A.bit CY, PSW.bit CY, [HL].bit
CY CY (saddr.bit) CY CY sfr.bit CY CY A.bit CY CY PSW.bit CY CY (HL).bit CY CY CY CY CY CY CY CY CY CY sfr.bit 1 A.bit 1 PSW.bit 1 (saddr.bit) 0 sfr.bit 0 A.bit 0 PSW.bit 0 CY 1 CY 0 CY CY x x x x (saddr.bit) sfr.bit A.bit PSW.bit (HL).bit
XOR1
CY, saddr.bit CY, sfr.bit CY, A.bit CY, PSW. bit CY, [HL].bit
SET1
saddr.bit sfr.bit A.bit PSW.bit [HL].bit
(saddr.bit) 1
x
8 + n + m (HL).bit 1
CLR1
saddr.bit sfr.bit A.bit PSW.bit [HL].bit
6 8 - 6
x
8 + n + m (HL).bit 0
SET1 CLR1 NOT1
CY CY CY
- - -
1 0 x
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from. 4. m is the number of waits when external memory expansion area is written to.
460
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group Call/return CALL CALLF
Clocks Operands !addr16 !addr11 Bytes
Note 1 Note 2
Flag Operation Z AC CY
3 2
7 5
- -
(SP - 1) (PC + 3)H, (SP - 2) (PC + 3)L, PC addr16, SP SP - 2 (SP - 1) (PC + 2)H, (SP - 2) (PC + 2)L, PC15 - 11 00001, PC10 - 0 addr11, SP SP - 2 (SP - 1) (PC + 1)H, (SP - 2) (PC + 1)L, PCH (00000000, addr5 + 1), PCL (00000000, addr5), SP SP - 2 (SP - 1) PSW, (SP - 2) (PC + 1)H, (SP - 3) (PC + 1)L, PCH (003FH), PCL (003EH), SP SP - 3, IE 0 PCH (SP + 1), PCL (SP), SP SP + 2 PCH (SP + 1), PCL (SP), PSW (SP + 2), SP SP + 3 PCH (SP + 1), PCL (SP), PSW (SP + 2), SP SP + 3 (SP - 1) PSW, SP SP - 1 (SP - 1) rpH, (SP - 2) rpL, SP SP - 2 PSW (SP), SP SP + 1 rpH (SP + 1), rpL (SP), SP SP + 2 SP word SP AX AX SP PC addr16 PC PC + 2 + jdisp8 PCH A, PCL X PC PC + 2 + jdisp8 if CY = 1 PC PC + 2 + jdisp8 if CY = 0 PC PC + 2 + jdisp8 if Z = 1 PC PC + 2 + jdisp8 if Z = 0 R R R R R R R R R
CALLT
[addr5]
1
6
-
BRK
1
6
-
RET RETI RETB Stack manipulate PUSH PSW rp POP PSW rp MOVW SP, #word SP, AX AX, SP Unconditional branch BR !addr16 $addr16 AX $addr16 $addr16 $addr16 $addr16
1 1 1 1 1 1 1 4 2 2 3 2 2 2 2 2 2
6 6 6 2 4 2 4 - - - 6 6 8 6 6 6 6
- - - - - - - 10 8 8 - - - - - - -
Conditional BC branch BNC BZ BNZ
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM.
User's Manual U14260EJ3V1UD
461
CHAPTER 24
INSTRUCTION SET
Instruction Mnemonic Group Conditional branch BT
Clocks Operands saddr.bit, $addr16 sfr.bit, $addr16 A.bit, $addr16 PSW.bit, $addr16 [HL].bit, $addr16 Bytes
Note 1 Note 2
Flag Operation Z AC CY
3 4 3 3 3 4 4 3 4 3 4 4 3 4 3 2 2 3 2 1 2 2 2 2
8 - 8 - 10 10 - 8 - 10 10 - 8 - 10 6 6 8 4 2 - - 6 6
9 11 - 9 11 + n 11 11 - 11 11 + n 12 12 - 12
PC PC + 3 + jdisp8 if (saddr.bit) = 1 PC PC + 4 + jdisp8 if sfr.bit = 1 PC PC + 3 + jdisp8 if A.bit = 1 PC PC + 3 + jdisp8 if PSW.bit = 1 PC PC + 3 + jdisp8 if (HL).bit = 1 PC PC + 4 + jdisp8 if (saddr.bit) = 0 PC PC + 4 + jdisp8 if sfr.bit = 0 PC PC + 3 + jdisp8 if A.bit = 0 PC PC + 4 + jdisp8 if PSW.bit = 0 PC PC + 3 + jdisp8 if (HL).bit = 0 PC PC + 4 + jdisp8 if (saddr.bit) = 1 then reset (saddr.bit) PC PC + 4 + jdisp8 if sfr.bit = 1 then reset sfr.bit PC PC + 3 + jdisp8 if A.bit = 1 then reset A.bit PC PC + 4 + jdisp8 if PSW.bit = 1 then reset PSW.bit then reset (HL).bit x x x
BF
saddr.bit, $addr16 sfr.bit, $addr16 A.bit, $addr16 PSW.bit, $addr16 [HL].bit, $addr16
BTCLR
saddr.bit, $addr16 sfr.bit, $addr16 A.bit, $addr16 PSW.bit, $addr16 [HL].bit, $addr16
12 + n + m PC PC + 3 + jdisp8 if (HL).bit = 1
DBNZ
B, $addr16 C, $addr16 saddr, $addr16
- - 10 - - 6 6 - -
B B - 1, then PC PC + 2 + jdisp8 if B 0 C C -1, then PC PC + 2 + jdisp8 if C 0 (saddr) (saddr) - 1, then PC PC + 3 + jdisp8 if (saddr) 0 RBS1, 0 n No Operation IE 1 (Enable Interrupt) IE 0 (Disable Interrupt) Set HALT Mode Set STOP Mode
CPU control
SEL NOP EI DI HALT STOP
RBn
Notes 1. When the internal high-speed RAM area is accessed or an instruction with no data access is executed. 2. When an area except the internal high-speed RAM area is accessed Remarks 1. One instruction clock cycle is one cycle of the CPU clock (fCPU) selected by the processor clock control register (PCC). 2. The number of clocks applies when there is a program in the internal ROM. 3. n is the number of waits when external memory expansion area is read from. 4. m is the number of waits when external memory expansion area is written to.
462
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
24.3 Instructions Listed by Addressing Type
(1) 8-bit instructions MOV, XCH, ADD, ADDC, SUB, SUBC, AND, OR, XOR, CMP, MULU, DIVUW, INC, DEC, ROR, ROL, RORC, ROLC, ROR4, ROL4, PUSH, POP, DBNZ
User's Manual U14260EJ3V1UD
463
CHAPTER 24
INSTRUCTION SET
Second Operand #byte First Operand A ADD ADDC SUB SUBC AND OR XOR CMP MOV MOV XCH XCH ADD ADDC SUB SUBC AND OR XOR CMP MOV ADD ADDC SUB SUBC AND OR XOR CMP B, C sfr saddr MOV MOV MOV XCH ADD ADDC SUB SUBC AND OR XOR CMP MOV MOV XCH ADD ADDC SUB SUBC AND OR XOR CMP MOV XCH MOV XCH ADD ADDC SUB SUBC AND OR XOR CMP A rNote sfr saddr !addr16 PSW [DE] [HL]
[HL + byte] [HL + B] $addr16 [HL + C] MOV XCH ADD ADDC SUB SUBC AND OR XOR CMP
1
None
ROR ROL RORC ROLC
r
MOV
INC DEC
DBNZ
MOV MOV ADD ADDC SUB SUBC AND OR XOR CMP MOV MOV MOV
DBNZ
INC DEC
!addr16 PSW
PUSH POP
[DE] [HL]
MOV MOV ROR4 ROL4
[HL + byte] [HL + B] [HL + C] X C
MOV
MULU DIVUW
Note Except r = A
464
User's Manual U14260EJ3V1UD
CHAPTER 24
INSTRUCTION SET
(2) 16-bit instructions MOVW, XCHW, ADDW, SUBW, CMPW, PUSH, POP, INCW, DECW
Second Operand #word First Operand AX ADDW SUBW CMPW rp MOVW MOVWNote INCW DECW PUSH POP MOVW XCHW MOVW MOVW MOVW MOVW AX rpNote sfrp saddrp !addr16 SP None
sfrp saddrp !addr16 SP
MOVW MOVW
MOVW MOVW MOVW
MOVW
MOVW
Note Only when rp = BC, DE, HL (3) Bit manipulation instructions MOV1, AND1, OR1, XOR1, SET1, CLR1, NOT1, BT, BF, BTCLR
Second Operand A.bit First Operand A.bit MOV1 BT BF BTCLR BT BF BTCLR BT BF BTCLR BT BF BTCLR BT BF BTCLR SET1 CLR1 sfr.bit saddr.bit PSW.bit [HL].bit CY $addr16 None
sfr.bit
MOV1
SET1 CLR1
saddr.bit
MOV1
SET1 CLR1
PSW.bit
MOV1
SET1 CLR1
[HL].bit
MOV1
SET1 CLR1
CY
MOV1 AND1 OR1 XOR1
MOV1 AND1 OR1 XOR1
MOV1 AND1 OR1 XOR1
MOV1 AND1 OR1 XOR1
MOV1 AND1 OR1 XOR1
SET1 CLR1 NOT1
User's Manual U14260EJ3V1UD
465
CHAPTER 24
INSTRUCTION SET
(4) Call instructions/branch instructions CALL, CALLF, CALLT, BR, BC, BNC, BZ, BNZ, BT, BF, BTCLR, DBNZ
Second Operand AX First Operand Basic instruction BR CALL BR CALLF CALLT BR BC BNC BZ BNZ Compound instruction BT BF BTCLR DBNZ !addr16 !addr11 [addr5] $addr16
(5) Other instructions ADJBA, ADJBS, BRK, RET, RETI, RETB, SEL, NOP, EI, DI, HALT, STOP
466
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Target products: PD780076, 780078, 78F0078 for which orders were received after February 1, 2002 (Products with a rankNote other than K) Note The rank is indicated by the 5th digit from the left in the lot number marked on the package.
Lot number
Year code Week code Rank
Absolute Maximum Ratings (TA = 25C)
Parameter Supply voltage Symbol VDD VPP AVREF AVSS Input voltage VI1 P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, X1, X2, XT1, XT2, RESET P30 to P33 N-ch open- No pull-up resistor drain Output voltage Analog input voltage Output current, high VO VAN IOH P10 to P17 Per pin Total for P00 to P03, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 Total for P20 to P25, P30 to P36 Output current, low IOL Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Operating ambient temperature Storage temperature TA During normal operation During flash memory programming Tstg Analog input pin Pull-up resistor Conditions Ratings -0.3 to +6.5 Unit V V V V V
PD78F0078 only, Note 2
-0.5 to +10.5 -0.3 to VDD + 0.3Note 1 -0.3 to +0.3 -0.3 to VDD + 0.3Note 1
VI2
-0.3 to +6.5 -0.3 to VDD + 0.3Note 1 -0.3 to VDD + 0.3Note 1 0.3Note 1 AVSS - 0.3 to AVREF + and -0.3 to VDD + 0.3Note 1 -10 -15 -15 20 30 50 20 100 100 -40 to +85 +10 to +40 -65 to +150 -40 to +125
V V V V mA mA mA mA mA mA mA mA mA C C C C
PD780076, 780078 PD78F0078
Note 1. 6.5 V or below (Note 2 is explained on the next page.) Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any parameter. That is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
467
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Note
2.
Make sure that the following conditions of the VPP voltage application timing are satisfied when the flash memory is written. * When supply voltage rises VPP must exceed VDD 10 s or more after VDD has reached the lower-limit value (2.7 V) of the operating voltage range (see a in the figure below). * When supply voltage drops VDD must be lowered 10 s or more after VPP falls below the lower-limit value (2.7 V) of the operating voltage range of VDD (see b in the figure below).
VDD
2.7 V 0V a b
VPP 2.7 V 0V
Capacitance (TA = 25C, VDD = VSS = 0 V)
Parameter Input capacitance I/O capacitance Symbol CIN Conditions f = 1 MHz Unmeasured pins returned to 0 V. f = 1 MHz Unmeasured pins returned to 0 V. P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 P30 to P33 MIN. TYP. MAX. 15 Unit pF
CIO
15
pF
20
pF
Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
468
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Main System Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Ceramic resonator X2 Rd C2 C1 Oscillation stabilization timeNote 2 X1 VSS1 Recommended Circuit Parameter Oscillation frequency (fX)Note 1 Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 1.8 V VDD < 3.0 V After VDD reaches oscillation voltage range MIN. Crystal resonator X2 Rd C2 C1 X1 VSS1 Oscillation frequency (fX)Note 1 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 1.8 V VDD < 3.0 V Oscillation stabilization External clock X2 X1 X1 input frequency (fX)Note 1 timeNote 2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 1.8 V VDD < 3.0 V X1 input high-/low-level width (tXH, tXL) 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 1.8 V VDD < 3.0 V 1.0 1.0 1.0 38 50 85 1.0 1.0 1.0 12.0 8.38 5.0 10 30 12.0 8.38 5.0 500 500 500 ns MHz ms MHz MIN. 1.0 1.0 1.0 TYP. MAX. 12.0 8.38 5.0 4 ms Unit MHz
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after reset or STOP mode release. Cautions 1. When using the main system clock oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. When the main system clock is stopped and the system is operating on the subsystem clock, wait until the oscillation stabilization time has been secured by the program before switching back to the main system clock.
User's Manual U14260EJ3V1UD
469
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Subsystem Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Crystal resonator Recommended Circuit
XT2 XT1 VSS1 Rd C4 C3
Parameter Oscillation frequency (fXT)Note 1 Oscillation stabilization timeNote 2 XT1 input frequency (fXT)Note 1 XT1 input high-/low-level width (tXTH, tXTL)
Conditions
MIN. 32
TYP. 32.768
MAX. 35
Unit kHz
4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 32
1.2
2 10 38.5
s
External clock
kHz
XT2
XT1
12
15
s
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after VDD reaches oscillation voltage range MIN. Cautions 1. When using the subsystem clock oscillator, wire as follows in the area enclosed by the broken lines in the above figure to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. The subsystem clock oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the main system clock oscillator. Particular care is therefore required with the wiring method when the subsystem clock is used.
470
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Recommended Oscillator Constant (1) PD780076, 780078 (a) Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 CSTCE10M0G52 CSTLS10M0G53 CSTCE12M0G52 CSTLA12M0T55 TDK CCR3.5MC5 CCR4.0MC5 CCR4.19MC5 CCR5.0MC5 CCR6.0MC5 CCR8.0MC5 CCR8.38MC5 CCR10.0MC5 CCR12.0MC5 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 10.00 10.00 12.00 12.00 3.58 4.00 4.19 5.00 6.00 8.00 8.38 10.00 12.00 Recommended Circuit Constant C1 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip Rd (k) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 4.5 4.5 4.5 4.5 1.8 1.8 1.8 2.7 2.7 3.0 3.0 4.5 4.5 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078 Subseries within the specifications of the DC and AC characteristics.
User's Manual U14260EJ3V1UD
471
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(1) PD780076, 780078 (b) Main system clock: Crystal resonator (TA = -10 to +70C)
Manufacturer Part Number Frequency (MHz) KINSEKI, Ltd. HC-49/U-S 4.19 8.38 Recommended Circuit Constant C1 (pF) 18 27 C2 (pF) 18 27 Rd (k) 4.7 0 Oscillation Voltage Range MIN. (V) 1.9 3.0 MAX. (V) 5.5 5.5
(c) Subsystem clock: Crystal resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (kHz) Seiko Epson Corporation C-022RX MC-206 MC-306 32.768 32.768 32.768 Recommended Circuit Constant C1 (pF) 15 15 15 C2 (pF) 15 15 15 Rd (k) 330 330 330 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 MAX. (V) 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078 Subseries within the specifications of the DC and AC characteristics.
472
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(2) PD78F0078 Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 CSTCE10M0G52 CSTLS10M0G53 CSTLS10M0G55093 CSTCE12M0G52 CSTLA12M0T55 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 10.00 10.00 10.00 12.00 12.00 Recommended Circuit Constant C1 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip R1 (k) 3.3 3.3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 4.5 4.5 4.5 4.5 4.5 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078 Subseries within the specifications of the DC and AC characteristics.
Remark For the resonator selection and oscillator constant, users are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
User's Manual U14260EJ3V1UD
473
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Output current, high Output current, low IOL Symbol IOH Per pin All pins Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Input voltage, high VIH1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIH2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 0.8VDD 0.85VDD 0.7VDD 0.8VDD VDD - 0.5 VDD - 0.2 0.8VDD 0.9VDD 0 0 0 0 0 0 0 0 0 0 0 VDD - 1.0 VDD - 0.5 VDD VDD 5.5 5.5 VDD VDD VDD VDD 0.3VDD 0.2VDD 0.2VDD 0.15VDD 0.3VDD 0.2VDD 0.1VDD 0.4 0.2 0.2VDD 0.1VDD VDD VDD 2.0 V V V V V V V V V V V V V V V V V V V V V V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 0.7VDD 0.8VDD 15 20 10 70 70 VDD VDD mA mA mA mA mA V V Conditions MIN. TYP. MAX. -1 -15 10 Unit mA mA mA
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIH3 P30 to P33 (N-ch open-drain) VIH4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIH5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Input voltage, low VIL1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIL2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V VIL4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIL5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Output voltage, high Output voltage, low VOL2 P50 to P57 VOL1 VOH1 4.0 V VDD 5.5 V, IOH = -1 mA 1.8 V VDD < 4.0 V, IOH = -100 A P30 to P33 4.0 V VDD 5.5 V, IOL = 15 mA 4.0 V VDD 5.5 V, IOL = 15 mA VOL3 P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 VOL4 IOL = 400 A 4.0 V VDD 5.5 V, IOL = 1.6 mA 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIL3 P30 to P33 (N-ch open-drain)
0.4
2.0
V
0.4
V
0.5
V
Remark
Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
474
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Input leakage current, high Symbol ILIH1 VIN = VDD Conditions P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 VIN = 5.5 V VIN = 0 V P30 to P33 P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 P30 to P33 VOUT = VDD VOUT = 0 V VIN = 0 V, P30, P31, P32, P33 15 30 MIN. TYP. MAX. 3 Unit
A
ILIH2 ILIH3 Input leakage current, low ILIL1
20 3 -3
A A A
ILIL2 ILIL3 Output leakage current, high Output leakage current, low Mask option pull-up resistance (mask ROM version only) Software pullup resistance VPP (IC) power supply voltage ILOH ILOL R1
-20 -3 3 -3 90
A A A A
k
R2
VIN = 0 V, P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 During normal operation
15
30
90
k
VPP1
0
0.2VDD
V
Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
475
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (1) PD780076, 780078
Parameter Power supply currentNote 1 Symbol Conditions When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating VDD = 3.0 V + 10%Notes 3, 6 When A/D converter is stopped When A/D converter is operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 12.0 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating VDD = 3.0 V + 10%Notes 3, 6 When peripheral functions are stopped When peripheral functions are operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
MIN.
TYP. 9.0 10.0 5.5 6.5 3.5 4.5 2.0 3.0 0.4 1.4 2.5
MAX. 18.0 20.0 11.0 13.0 7.0 9.0 4.0 6.0 1.5 4.2 5.0 11.5
Unit mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA
IDD1Note 2 12.0 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode
1.1
2.2 4.7
0.7
1.4 4.5
0.35
0.7 1.7
0.15
0.4 1.1
32.768 kHz crystal oscillation operating modeNote 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
40 20 10 30 6 2 0.1 0.05 0.05
80 40 20 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP
modeNote 7
476
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. The values show the specifications when VDD = 3.0 to 3.3 V. The value in the TYP. column shows the specifications when VDD = 3.0 V. 7. When the main system clock and subsystem clock are stopped.
User's Manual U14260EJ3V1UD
477
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (2) PD78F0078
Parameter Power supply currentNote 1 Symbol Conditions When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating VDD = 3.0 V + 10%Notes 3, 6 When A/D converter is stopped When A/D converter is operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 12.0 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating VDD = 3.0 V + 10%Notes 3, 6 When peripheral functions are stopped When peripheral functions are operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
MIN.
TYP. 17.0 18.0 10.5 11.5 7.0 8.0 4.5 5.5 1.0 2.0 2.5
MAX. 34.0 36.0 21.0 23.0 14.0 16.0 9.0 11.0 2.0 6.0 5.0 11.5
Unit mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA
IDD1Note 2 12.0 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode
1.2
2.4 5.0
0.7
1.4 4.5
0.4
0.8 1.7
0.2
0.4 1.1
32.768 kHz crystal oscillation operating modeNote 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
115 95 75 30 6 2 0.1 0.05 0.05
230 190 150 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP
modeNote 7
478
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. The values show the specifications when VDD = 3.0 to 3.3 V. The value in the TYP. column shows the specifications when VDD = 3.0 V. 7. When the main system clock and subsystem clock are stopped.
User's Manual U14260EJ3V1UD
479
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
AC Characteristics (1) Basic operation (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Cycle time (Min. instruction execution time) Symbol TCY Operating with main system clock Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V Operating with subsystem clock TI000, TI010, TI001, TI011 input high-/lowlevel width TI50, TI51 input frequency TI50, TI51 input high-/low-level width Interrupt request input high-/lowlevel width RESET low-level width tRSL tINTH, tINTL INTP0 to INTP3, P40 to P47 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 1 2 10 20 tTIH5, tTIL5 fTI5 tTIH0, tTIL0 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V MIN. 0.166 0.238 0.4 1.6 103.9Note 1 2/fsam + 0.1Note 2 122 TYP. MAX. 16 16 16 16 125 Unit
s s s s s s s s
2/fsam + 0.2Note 2 2/fsam + 0.5Note 2 0 0 100 1.8 4 275
MHz kHz ns
s s s s s
Notes 1. Value when the external clock is used. When a crystal resonator is used, it is 114 s (MIN.). 2. Selection of fsam = fX, fX/4, fX/64 is possible using bits 0 and 1 (PRM000, PRM010) of prescaler mode register 00 (PRM00). Selection of fsam = fX/2, fX/8, fX/512 is possible using bits 0 and 1 (PRM001, PRM011) of prescaler mode register 01 (PRM01). However, if the TI000 or TI001 valid edge is selected as the count clock, the value becomes fsam = fX/8.
480
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
TCY vs. VDD (main system clock operation)
16.0 10.0
Cycle time TCY [ s]
5.0
Operation guaranteed range
2.0 1.6 1.0
0.4 0.238 0.166 0.1 0 1.0 1.8 2.0 2.7 3.0 4.0 4.5 5.0 5.5 6.0
Supply voltage VDD [V]
User's Manual U14260EJ3V1UD
481
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(2) Read/write operation (TA = -40 to +85C, VDD = 4.0 to 5.5 V) (1/3)
Parameter ASTB high-level width Address setup time Address hold time Data input time from address Symbol tASTH tADS tADH tADD1 tADD2 Address output time from RD Data input time from RD tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Address hold time from RD at external fetch Write data output time from RD Write data output time from WR Address hold time from WR Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 10 0.8tCY - 15 0.8tCY 0.8tCY 60 1.2tCY + 30 2.5tCY + 25 2.5tCY + 25 ns ns ns ns ns tRDADH 0.8tCY - 15 1.2tCY + 30 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + n)tCY + 10 60 6 (1.5 + 2n)tCY - 15 6 2tCY - 15 0.8tCY - 15 1.2tCY 0 (1.5 + 2n)tCY - 33 (2.5 + 2n)tCY - 33 tCY - 43 tCY - 43 tCY - 25 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 20 6 (2 + 2n)tCY - 54 (3 + 2n)tCY - 60 100 (2 + 2n)tCY - 87 (3 + 2n)tCY - 93 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 0.238 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
482
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(2) Read/write operation (TA = -40 to +85C, VDD = 2.7 to 4.0 V) (2/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 20 0.8tCY - 30 0.5tCY 0.5tCY 120 1.2tCY + 60 2.5tCY + 50 2.5tCY + 50 ns ns ns ns ns tRDADH 0.8tCY - 30 1.2tCY + 60 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 10 (1.5 + 2n)tCY - 30 10 2tCY - 30 0.8tCY - 30 1.2tCY 0 (1.5 + 2n)tCY - 40 (2.5 + 2n)tCY - 40 tCY - 75 tCY - 60 tCY - 50 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 30 10 (2 + 2n)tCY - 108 (3 + 2n)tCY - 120 200 (2 + 2n)tCY - 148 (3 + 2n)tCY - 162 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 0.4 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
User's Manual U14260EJ3V1UD
483
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(2) Read/write operation (TA = -40 to +85C, VDD = 1.8 to 2.7 V) (3/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 40 0.8tCY - 60 0.5tCY 0.5tCY 240 1.2tCY + 120 2.5tCY + 100 2.5tCY + 100 ns ns ns ns ns tRDADH 0.8tCY - 60 1.2tCY + 120 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 20 (1.5 + 2n)tCY - 60 20 2tCY - 60 0.8tCY - 60 1.2tCY 0 (1.5 + 2n)tCY - 92 (2.5 + 2n)tCY - 92 tCY - 350 tCY - 132 tCY - 100 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 120 20 (2 + 2n)tCY - 233 (3 + 2n)tCY - 240 400 (2 + 2n)tCY - 325 (3 + 2n)tCY - 332 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 1.6 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
484
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(3) Serial interface (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (a) SIO3 3-wire serial I/O mode (SCK3 ... Internal clock output)
Parameter SCK3 cycle time Symbol tKCY1 Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width SI3 setup time (to SCK3) tSIK1 tKH1, tKL1 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSO1 tKSI1 4.5 V VDD 5.5 V 1.8 V VDD < 4.5 V C = 100 pF
Note
MIN. 666 954 1600 3200 tKCY1/2 - 50 tKCY1/2 - 100 100 150 300 300 400
TYP.
MAX.
Unit ns ns ns ns ns ns ns ns ns ns ns
4.5 V VDD 5.5 V 1.8 V VDD < 4.5 V
200 300
ns ns
Note C is the load capacitance of the SCK3 and SO3 output lines. (b) SIO3 3-wire serial I/O mode (SCK3 ... External clock input)
Parameter SCK3 cycle time Symbol tKCY2 Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width tKH2, tKL2 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SI3 setup time (to SCK3) SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSO2 tKSI2 4.5 V VDD 5.5 V 1.8 V VDD < 4.5 V C = 100 pF
Note
MIN. 666 800 1600 3200 333 400 800 1600 100
TYP.
MAX.
Unit ns ns ns ns ns ns ns ns ns
tSIK2
300 400 200 300
ns ns ns ns
4.5 V VDD 5.5 V 1.8 V VDD < 4.5 V
Note C is the load capacitance of the SO3 output line.
User's Manual U14260EJ3V1UD
485
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(c) CSI1 3-wire serial I/O mode (SCK1 ... Internal clock output)
Parameter SCK1 cycle time Symbol tKCY3 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH3, tKL3 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tSIK3 MIN. 200 500 1 tKCY3/2 - 5 tKCY3/2 - 20 tKCY3/2 - 30 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSI3 C = 100 pFNote
110
ns
tKSO3
150
ns
Note C is the load capacitance of the SCK1 and SO1 output lines. (d) CSI1 3-wire serial I/O mode (SCK1 ... External clock input)
Parameter SCK1 cycle time Symbol tKCY4 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH4, tKL4 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tKSI4 C = 100 pFNote 110 ns tSIK4 MIN. 200 500 1 100 250 500 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSO4
150
ns
Note C is the load capacitance of the SO1 output line.
(e) UART0 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 187500 131031 78125 39063 Unit bps bps bps bps
486
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(f)
UART0 (external clock input)
Parameter Symbol tKCY5 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 39063 19531 9766 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK0 cycle time
ASCK0 high-/low-level width
tKH5, tKL5
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
(g) UART0 (infrared data transfer mode)
Parameter Transfer rate Bit rate tolerance Output pulse width Input pulse width Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 131031 0.87 0.24/fbrNote Unit bps %
s s
Note fbr: Specified baud rate (h) UART2 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 262062 156250 62500 Unit bps bps bps
(i)
UART2 (external clock input)
Parameter Symbol tKCY6 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 78125 39063 19531 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK2 cycle time
ASCK2 high-/low-level width
tKH6, tKL6
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
User's Manual U14260EJ3V1UD
487
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(j)
UART2 (infrared data transfer mode)
Parameter Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 262062 0.87 0.24/fbrNote Unit bps %
Transfer rate Bit rate tolerance Output pulse width Input pulse width
s s
Note fbr: Specified baud rate A/D Converter Characteristics (TA = -40 to +85C, 2.2 V AVREF VDD 5.5 V, AVSS = VSS = 0 V)
Parameter Resolution Overall error
Note
Symbol
Conditions
MIN. 10
TYP. 10 0.2 0.3 0.6
MAX. 10 0.4 0.6 1.2 96 96 96 96 0.4 0.6 1.2 0.4 0.6 1.2 2.5 4.5 8.5 1.5 2.0 3.5 100
Unit bit %FSR %FSR %FSR
4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
Conversion time
tCONV
4.5 V AVREF 5.5 V 4.0 V AVREF < 4.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
12 14 17 28
s s s s
%FSR %FSR %FSR %FSR %FSR %FSR LSB LSB LSB LSB LSB LSB k M
Zero-scale
errorNote
4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
Full-scale
errorNote
4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
Integral linear error
4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
Differential linear error
4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V
Analog input impedance
During sampling Other than during sampling 10 0 During A/D conversion 20 40
Analog input voltage AVREF resistance
VAIN RREF
AVREF
V k
Note Overall error excluding quantization error (1/2 LSB). This value is indicated as a ratio to the full-scale value. Remark FSR: Full-scale range
488
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = -40 to +85C)
Parameter Data retention power supply voltage Data retention power supply current Release signal set time Oscillation stabilization wait time Symbol VDDDR Conditions MIN. 1.6 TYP. MAX. 5.5 Unit V
IDDDR
Subsystem clock stop (XT1 = VDD) and feedback resistor disconnected 0 Release by RESET Release by interrupt request
0.1
30
A s
tSREL tWAIT
217/fx Note
s s
Note Selection of 212/fX and 214/fX to 217/fX is possible using bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization time select register (OSTS). Flash Memory Programming Characteristics (TA = +10 to +40C, VDD = 2.7 to 5.5 V, VSS = AVSS = 0 V) (1) Write erase characteristics
Parameter Operating frequency Symbol fX Conditions 4.5 V VDD 5.5 V 3.0 V VDD < 4.5 V 2.7 V VDD < 3.0 V VPP supply voltage VDD supply current VPP2 IDD During flash memory programming When fX = 10.0 MHz VDD = 5.0 V10% MIN. 1.0 1.0 1.0 9.7 10.0 TYP. MAX. 10.0 8.38 5.00 10.3 29 24 17 75 0.99 When step erase time = 1 s 50 When step write time = 100 s 1 erase + 1 write after erase = 1 rewrite 1.0 100 1.01 20 100 1000 20 Unit MHz MHz MHz V mA mA mA mA s s/area
VPP = VPP2 fX = 8.38 MHz VDD = 5.0 V10% VDD = 3.0 V10% VPP supply current Step erase time
Note 1 Note 2
IPP Ter Tera Twr
Note 3 Note 4
When VPP = VPP2
Overall erase time per area Step write time Overall write time per word
s s
Times/area
Twrw Cerwr
Number of rewrites per area
Notes
1. The recommended setting value of the step erase time is 1 s. 2. The prewrite time before erasure and the erase verify time (writeback time) are not included. 3. The actual write time per word is 100 s longer. The internal verify time during or after a write is not included. 4. When a product is first written after shipment, "erase write" and "write only" are both taken as one rewrite. Example: P: Write, E: Erase Shipped product PEPEP: 3 rewrites Shipped product EPEPEP: 3 rewrites
User's Manual U14260EJ3V1UD
489
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
(2) Serial write operation characteristics
Parameter Set time from VDD to VPP Release time from VPP to RESET VPP pulse input start time from RESET VPP pulse high-/low-level width VPP pulse input end time from RESET VPP pulse low-level input voltage VPP pulse high-level input voltage Symbol tDP tPR tRP Conditions MIN. 10 1.0 1.0 TYP. MAX. Unit
s s s s
20 ms
tPW tRPE
8.0
VPPL VPPH
0.8VDD 9.7
VDD 10.0
1.2VDD 10.3
V V
490
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Timing Chart
AC Timing Test Points (Excluding X1, XT1 Inputs)
0.8VDD 0.2VDD
Test points
0.8VDD 0.2VDD
Clock Timing
1/fX
tXL
tXH VIH4 (MIN.) VIL4 (MAX.)
X1 input
1/fXT
tXTL XT1 input
tXTH VIH5 (MIN.) VIL5 (MAX.)
TI Timing
tTIL0 tTIH0
TI000, TI010, TI001, TI011
1/fTI5 tTIL5 tTIH5
TI50, TI51
User's Manual U14260EJ3V1UD
491
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Interrupt Request Input Timing
tINTL tINTH
INTP0 to INTP3
RESET Input Timing
tRSL
RESET
492
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Read/Write Operation External fetch (no wait):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH
Hi-Z tRDAD tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD tRDL1 tRDH
External fetch (wait insertion):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH tRDAD
Hi-Z tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD WAIT tRDWT1 tWTL tWTRD tRDL1 tRDH
User's Manual U14260EJ3V1UD
493
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
External data access (no wait):
A8 to A15 tADD2 AD0 to AD7 Lower 8-bit address tADS tASTH ASTB tADH Hi-Z tRDAD tRDD2
Higher 8-bit address
Read data
Write data
Hi-Z
tRDH
RD tASTRD WR tASTWR tWRL1 tRDL2 tRDWD tWRWD tWDS tWDH tWRADH
External data access (wait insertion):
A8 to A15 tADD2 AD0 to AD7
Lower 8-bit address
Higher 8-bit address
Hi-Z Hi-Z
Read data
tRDH
Write data
tADS tADH tASTH ASTB
tRDAD tRDD2 tASTRD
RD
tRDL2
tRDWD tWRWD
tWDS
tWDH
WR
tASTWR WAIT tRDWT2 tWTL tWTRD tWRWT tWTL tWTWR tWRL1 tWRADH
494
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Data Retention Timing (STOP Mode Release by RESET)
Internal reset operation HALT mode STOP mode Operating mode
Data retention mode
VDD
STOP instruction execution
VDDDR
tSREL
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode STOP mode Operating mode
Data retention mode
VDD STOP instruction execution Standby release signal (interrupt request)
VDDDR tSREL
tWAIT
User's Manual U14260EJ3V1UD
495
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Serial Transfer Timing 3-wire serial I/O mode:
tKCYn tKLn tKHn
SCK1, SCK3
tSIKn
tKSIn
SI1, SI3
tKSOn
Input data
SO1, SO3
Output data
Remark n = 1 to 4
UART mode (external clock input):
tKCYn t KLn tKHn
ASCK0, ASCK2
Remark n = 5, 6
496
User's Manual U14260EJ3V1UD
CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078)
Flash Write Mode Setting Timing
VDD VDD 0V VPPH VPP VPPL 0V tPR tRPE VDD RESET (input) 0V Reset command SCK3
Note 1
tDP
tRP
tPW
tPW
0V
VIL
SI3Note 1/RxD0Note 2
0V
VIL
SO3Note 1/TxD0Note 2 0V
P31 (HS)Note 3
0V
Notes 1. 3-wire serial I/O (SIO3) type 2. UART (UART0) type 3. Handshake (when 3-wire serial I/O (SIO3) type is used)
User's Manual U14260EJ3V1UD
497
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Target products: PD780076Y, 780078Y, 78F0078Y for which orders were received after February 1, 2002 (Products with a rankNote other than K) Note The rank is indicated by the 5th digit from the left in the lot number marked on the package.
Lot number
Year code Week code Rank
Absolute Maximum Ratings (TA = 25C)
Parameter Supply voltage Symbol VDD VPP AVREF AVSS Input voltage VI1 P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, X1, X2, XT1, XT2, RESET P30 to P33 N-ch open- No pull-up resistor drain Output voltage Analog input voltage Output current, high VO VAN IOH P10 to P17 Per pin Total for P00 to P03, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 Total for P20 to P25, P30 to P36 Output current, low IOL Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Operating ambient temperature Storage temperature TA During normal operation During flash memory programming Tstg Analog input pin Pull-up resistor Conditions Ratings -0.3 to +6.5 Unit V V V V V
PD78F0078Y only, Note 2
-0.5 to +10.5 -0.3 to VDD + 0.3Note 1 -0.3 to +0.3 -0.3 to VDD + 0.3Note 1
VI2
-0.3 to +6.5 -0.3 to VDD + 0.3Note 1 -0.3 to VDD + 0.3Note 1 AVSS - 0.3 to AVREF + and -0.3 to VDD + 0.3Note 1 -10 -15 -15 20 30 50 20 100 100 -40 to +85 +10 to +40 -65 to +150 -40 to +125 0.3Note 1
V V V V mA mA mA mA mA mA mA mA mA C C C C
PD780076Y, 780078Y PD78F0078Y
Note 1. 6.5 V or below (Note 2 is explained on the next page.) Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any parameter. That is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
498
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Note
2.
Make sure that the following conditions of the VPP voltage application timing are satisfied when the flash memory is written. * When supply voltage rises VPP must exceed VDD 10 s or more after VDD has reached the lower-limit value (2.7 V) of the operating voltage range (see a in the figure below). * When supply voltage drops VDD must be lowered 10 s or more after VPP falls below the lower-limit value (2.7 V) of the operating voltage range of VDD (see b in the figure below).
VDD
2.7 V 0V a b
VPP 2.7 V 0V
Capacitance (TA = 25C, VDD = VSS = 0 V)
Parameter Input capacitance I/O capacitance Symbol CIN Conditions f = 1 MHz Unmeasured pins returned to 0 V. f = 1 MHz Unmeasured pins returned to 0 V. P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 P30 to P33 MIN. TYP. MAX. 15 Unit pF
CIO
15
pF
20
pF
Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
499
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Main System Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Ceramic resonator Recommended Circuit X2 Rd C2 C1 Oscillation stabilization timeNote 2 X1 VSS1 Parameter Oscillation frequency (fX)Note 1 Conditions 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V After VDD reaches oscillation voltage range MIN. 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 1.0 1.0 50 85 1.0 1.0 MIN. 1.0 1.0 TYP. MAX. 8.38 5.0 4 ms Unit MHz
Crystal resonator
X2 Rd C2
X1 VSS1
Oscillation frequency (fX)Note 1
8.38 5.0 10 30 8.38 5.0 500 500
MHz
C1
Oscillation stabilization timeNote 2
ms
External clock
X2
X1
X1 input frequency (fX)Note 1
MHz
X1 input high-/low-level width (tXH, tXL)
ns
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after reset or STOP mode release. Cautions 1. When using the main system clock oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. When the main system clock is stopped and the system is operating on the subsystem clock, wait until the oscillation stabilization time has been secured by the program before switching back to the main system clock.
500
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Subsystem Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Crystal resonator Recommended Circuit
XT2 XT1 VSS1 Rd C4 C3
Parameter Oscillation frequency (fXT)Note 1 Oscillation stabilization timeNote 2 XT1 input frequency (fXT)Note 1 XT1 input high-/low-level width (tXTH, tXTL)
Conditions
MIN. 32
TYP. 32.768
MAX. 35
Unit kHz
3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 32
1.2
2 10 38.5
s
External clock
kHz
XT2
XT1
12
15
s
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after VDD reaches oscillation voltage range MIN. Cautions 1. When using the subsystem clock oscillator, wire as follows in the area enclosed by the broken lines in the above figure to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. The subsystem clock oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the main system clock oscillator. Particular care is therefore required with the wiring method when the subsystem clock is used.
User's Manual U14260EJ3V1UD
501
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Recommended Oscillator Constant (1) PD780076Y, 780078Y (a) Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 TDK CCR3.5MC5 CCR4.0MC5 CCR4.19MC5 CCR5.0MC5 CCR6.0MC5 CCR8.0MC5 CCR8.38MC5 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 3.58 4.00 4.19 5.00 6.00 8.00 8.38 Recommended Circuit Constant C1 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip Rd (k) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 1.8 1.8 1.8 2.7 2.7 3.0 3.0 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078Y Subseries within the specifications of the DC and AC characteristics.
502
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(1) PD780076Y, 780078Y (b) Main system clock: Crystal resonator (TA = -10 to +70C)
Manufacturer Part Number Frequency (MHz) KINSEKI, Ltd. HC-49/U-S 4.19 8.38 Recommended Circuit Constant C1 (pF) 18 27 C2 (pF) 18 27 Rd (k) 4.7 0 Oscillation Voltage Range MIN. (V) 1.9 3.0 MAX. (V) 5.5 5.5
(c) Subsystem clock: Crystal resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (kHz) Seiko Epson Corporation C-022RX MC-206 MC-306 32.768 32.768 32.768 Recommended Circuit Constant C1 (pF) 15 15 15 C2 (pF) 15 15 15 Rd (k) 330 330 330 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 MAX. (V) 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078Y Subseries within the specifications of the DC and AC characteristics.
User's Manual U14260EJ3V1UD
503
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(2) PD78F0078Y Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 Recommended Circuit Constant C1 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip R1 (k) 3.3 3.3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078Y Subseries within the specifications of the DC and AC characteristics.
Remark For the resonator selection and oscillator constant, users are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
504
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Output current, high Output current, low IOL Symbol IOH Per pin All pins Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Input voltage, high VIH1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIH2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 0.8VDD 0.85VDD 0.7VDD 0.8VDD VDD - 0.5 VDD - 0.2 0.8VDD 0.9VDD 0 0 0 0 0 0 0 0 0 0 0 VDD - 1.0 VDD - 0.5 VDD VDD 5.5 5.5 VDD VDD VDD VDD 0.3VDD 0.2VDD 0.2VDD 0.15VDD 0.3VDD 0.2VDD 0.1VDD 0.4 0.2 0.2VDD 0.1VDD VDD VDD 2.0 V V V V V V V V V V V V V V V V V V V V V V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 0.7VDD 0.8VDD 15 20 10 70 70 VDD VDD mA mA mA mA mA V V Conditions MIN. TYP. MAX. -1 -15 10 Unit mA mA mA
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIH3 P30 to P33 (N-ch open-drain) VIH4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIH5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Input voltage, low VIL1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIL2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V VIL4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIL5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Output voltage, high Output voltage, low VOL2 P50 to P57 VOL1 VOH1 4.0 V VDD 5.5 V, IOH = -1 mA 1.8 V VDD < 4.0 V, IOH = -100 A P30 to P33 4.0 V VDD 5.5 V, IOL = 15 mA 4.0 V VDD 5.5 V, IOL = 15 mA VOL3 P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 VOL4 IOL = 400 A 4.0 V VDD 5.5 V, IOL = 1.6 mA 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIL3 P30 to P33 (N-ch open-drain)
0.4
2.0
V
0.4
V
0.5
V
Remark
Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
505
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Input leakage current, high Symbol ILIH1 VIN = VDD Conditions P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 VIN = 5.5 V VIN = 0 V P30 to P33 P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 P30 to P33 VOUT = VDD VOUT = 0 V VIN = 0 V, P30, P31 15 30 MIN. TYP. MAX. 3 Unit
A
ILIH2 ILIH3 Input leakage current, low ILIL1
20 3 -3
A A A
ILIL2 ILIL3 Output leakage current, high Output leakage current, low Mask option pull-up resistance (mask ROM version only) Software pullup resistance VPP (IC) power supply voltage ILOH ILOL R1
-20 -3 3 -3 90
A A A A
k
R2
VIN = 0 V, P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 During normal operation
15
30
90
k
VPP1
0
0.2VDD
V
Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
506
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (1) PD780076Y, 780078Y
Parameter Power supply currentNote 1 Symbol Conditions When A/D converter is stopped When A/D converter is operating VDD = 3.0 V + 10%Notes 3, 6 When A/D converter is stopped When A/D converter is operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode When peripheral functions are stopped When peripheral functions are operating VDD = 3.0 V + 10%Notes 3, 6 When peripheral functions are stopped When peripheral functions are operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
MIN.
TYP. 5.5 6.5 3.5 4.5 2.0 3.0 0.4 1.4 1.1
MAX. 11.0 13.0 7.0 9.0 4.0 6.0 1.5 4.2 2.2 4.7
Unit mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA
IDD1Note 2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode
0.7
1.4 4.5
0.35
0.7 1.7
0.15
0.4 1.1
32.768 kHz crystal oscillation operating mode
Note 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
40 20 10 30 6 2 0.1 0.05 0.05
80 40 20 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP modeNote 7
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. The values show the specifications when VDD = 3.0 to 3.3 V. The value in the TYP. column shows the specifications when VDD = 3.0 V. 7. When the main system clock and subsystem clock are stopped.
User's Manual U14260EJ3V1UD
507
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (2) PD78F0078Y
Parameter Power supply currentNote 1 Symbol Conditions When A/D converter is stopped When A/D converter is operating VDD = 3.0 V + 10%Notes 3, 6 When A/D converter is stopped When A/D converter is operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode When peripheral functions are stopped When peripheral functions are operating VDD = 3.0 V + 10%Notes 3, 6 When peripheral functions are stopped When peripheral functions are operating 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
MIN.
TYP. 10.5 11.5 7.0 8.0 4.5 5.5 1.0 2.0 1.2
MAX. 21.0 23.0 14.0 16.0 9.0 11.0 2.0 6.0 2.4 5.0
Unit mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA mA
IDD1Note 2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode
0.7
1.4 4.5
0.4
0.8 1.7
0.2
0.4 1.1
32.768 kHz crystal oscillation operating mode
Note 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
115 95 75 30 6 2 0.1 0.05 0.05
230 190 150 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP modeNote 7
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. The values show the specifications when VDD = 3.0 to 3.3 V. The value in the TYP. column shows the specifications when VDD = 3.0 V. 7. When the main system clock and subsystem clock are stopped.
508
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
AC Characteristics (1) Basic operation (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Cycle time (Min. instruction execution time) Symbol TCY Operating with main system clock Conditions 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V Operating with subsystem clock TI000, TI010, TI001, TI011 input high-/lowlevel width TI50, TI51 input frequency TI50, TI51 input high-/low-level width Interrupt request input high-/lowlevel width RESET low-level width tRSL tINTH, tINTL INTP0 to INTP3, P40 to P47 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 1 2 10 20 tTIH5, tTIL5 fTI5 tTIH0, tTIL0 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V MIN. 0.238 0.4 1.6 103.9Note 1 2/fsam + 2/fsam + 0.1Note 2 0.2Note 2 122 TYP. MAX. 16 16 16 125 Unit
s s s s s s s
2/fsam + 0.5Note 2 0 0 100 1.8 4 275
MHz kHz ns
s s s s s
Notes 1. Value when the external clock is used. When a crystal resonator is used, it is 114 s (MIN.). 2. Selection of fsam = fX, fX/4, fX/64 is possible using bits 0 and 1 (PRM000, PRM010) of prescaler mode register 00 (PRM00). Selection of fsam = fX/2, fX/8, fX/512 is possible using bits 0 and 1 (PRM001, PRM011) of prescaler mode register 01 (PRM01). However, if the TI000 or TI001 valid edge is selected as the count clock, the value becomes fsam = fX/8.
User's Manual U14260EJ3V1UD
509
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
TCY vs. VDD (main system clock operation)
16.0 10.0
Cycle time TCY [ s]
5.0
Operation guaranteed range
2.0 1.6 1.0
0.4 0.238 0.1 0 1.0 1.8 2.0 2.7 Supply voltage VDD [V] 3.0 4.0 5.0 5.5 6.0
510
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(2) Read/write operation (TA = -40 to +85C, VDD = 4.0 to 5.5 V) (1/3)
Parameter ASTB high-level width Address setup time Address hold time Data input time from address Symbol tASTH tADS tADH tADD1 tADD2 Address output time from RD Data input time from RD tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Address hold time from RD at external fetch Write data output time from RD Write data output time from WR Address hold time from WR Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 10 0.8tCY - 15 0.8tCY 0.8tCY 60 1.2tCY + 30 2.5tCY + 25 2.5tCY + 25 ns ns ns ns ns tRDADH 0.8tCY - 15 1.2tCY + 30 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + n)tCY + 10 60 6 (1.5 + 2n)tCY - 15 6 2tCY - 15 0.8tCY - 15 1.2tCY 0 (1.5 + 2n)tCY - 33 (2.5 + 2n)tCY - 33 tCY - 43 tCY - 43 tCY - 25 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 20 6 (2 + 2n)tCY - 54 (3 + 2n)tCY - 60 100 (2 + 2n)tCY - 87 (3 + 2n)tCY - 93 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 0.238 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
User's Manual U14260EJ3V1UD
511
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(2) Read/write operation (TA = -40 to +85C, VDD = 2.7 to 4.0 V) (2/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 20 0.8tCY - 30 0.5tCY 0.5tCY 120 1.2tCY + 60 2.5tCY + 50 2.5tCY + 50 ns ns ns ns ns tRDADH 0.8tCY - 30 1.2tCY + 60 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 10 (1.5 + 2n)tCY - 30 10 2tCY - 30 0.8tCY - 30 1.2tCY 0 (1.5 + 2n)tCY - 40 (2.5 + 2n)tCY - 40 tCY - 75 tCY - 60 tCY - 50 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 30 10 (2 + 2n)tCY - 108 (3 + 2n)tCY - 120 200 (2 + 2n)tCY - 148 (3 + 2n)tCY - 162 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 0.4 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
512
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(2) Read/write operation (TA = -40 to +85C, VDD = 1.8 to 2.7 V) (3/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 40 0.8tCY - 60 0.5tCY 0.5tCY 240 1.2tCY + 120 2.5tCY + 100 2.5tCY + 100 ns ns ns ns ns tRDADH 0.8tCY - 60 1.2tCY + 120 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 20 (1.5 + 2n)tCY - 60 20 2tCY - 60 0.8tCY - 60 1.2tCY 0 (1.5 + 2n)tCY - 92 (2.5 + 2n)tCY - 92 tCY - 350 tCY - 132 tCY - 100 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 120 20 (2 + 2n)tCY - 233 (3 + 2n)tCY - 240 400 (2 + 2n)tCY - 325 (3 + 2n)tCY - 332 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Caution Remarks
TCY can only be used when the MIN. value is 1.6 s. 1. 2. 3. tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
User's Manual U14260EJ3V1UD
513
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(3) Serial interface (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (a) SIO3 3-wire serial I/O mode (SCK3 ... Internal clock output)
Parameter SCK3 cycle time Symbol tKCY1 Conditions 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width SI3 setup time (to SCK3) tSIK1 tKH1, tKL1 3.0 V VDD 5.5 V 1.8 V VDD < 3.0 V 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSI1
Note
MIN. 954 1600 3200 tKCY1/2 - 50 tKCY1/2 - 100 100 150 300 400
TYP.
MAX.
Unit ns ns ns ns ns ns ns ns ns
tKSO1
C = 100 pF
300
ns
Note C is the load capacitance of the SCK3 and SO3 output lines. (b) SIO3 3-wire serial I/O mode (SCK3 ... External clock input)
Parameter SCK3 cycle time Symbol tKCY2 Conditions 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width tKH2, tKL2 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V SI3 setup time (to SCK3) SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSO2 C = 100 pF
Note
MIN. 800 1600 3200 400 800 1600 100
TYP.
MAX.
Unit ns ns ns ns ns ns ns
tSIK2
tKSI2
400
ns
300
ns
Note C is the load capacitance of the SO3 output line.
514
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(c) CSI1 3-wire serial I/O mode (SCK1 ... Internal clock output)
Parameter SCK1 cycle time Symbol tKCY3 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH3, tKL3 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tSIK3 MIN. 200 500 1 tKCY3/2 - 5 tKCY3/2 - 20 tKCY3/2 - 30 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSI3 C = 100 pFNote
110
ns
tKSO3
150
ns
Note C is the load capacitance of the SCK1 and SO1 output lines. (d) CSI1 3-wire serial I/O mode (SCK1 ... External clock input)
Parameter SCK1 cycle time Symbol tKCY4 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH4, tKL4 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tKSI4 C = 100 pFNote 110 ns tSIK4 MIN. 200 500 1 100 250 500 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSO4
150
ns
Note C is the load capacitance of the SO1 output line.
(e) UART0 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 131031 78125 39063 Unit bps bps bps
User's Manual U14260EJ3V1UD
515
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(f)
UART0 (external clock input)
Parameter Symbol tKCY5 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 39063 19531 9766 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK0 cycle time
ASCK0 high-/low-level width
tKH5, tKL5
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
(g) UART0 (infrared data transfer mode)
Parameter Transfer rate Bit rate tolerance Output pulse width Input pulse width Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 131031 0.87 0.24/fbrNote Unit bps %
s s
Note fbr: Specified baud rate (h) UART2 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 262062 156250 62500 Unit bps bps bps
(i)
UART2 (external clock input)
Parameter Symbol tKCY6 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 78125 39063 19531 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK2 cycle time
ASCK2 high-/low-level width
tKH6, tKL6
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
516
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
(j)
UART2 (infrared data transfer mode)
Parameter Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 262062 0.87 0.24/fbrNote Unit bps %
Transfer rate Bit rate tolerance Output pulse width Input pulse width
s s
Note fbr: Specified baud rate (k) I2C bus mode
Standard Mode Parameter SCL0 clock frequency Bus free time (between stop and start condition) Hold timeNote 1 SCL0 clock low-level width SCL0 clock high-level width Start/restart condition setup time Data hold time CBUS compatible master I2C bus Data setup time SDA0 and SCL0 signal rise time SDA0 and SCL0 signal fall time Stop condition setup time Capacitive load per each bus line Spike pulse width controlled by input filter tSU:DAT tR tF tSU:STO Cb tSP Symbol fSCL tBUF MIN. 0 4.7 MAX. 100 -- High-Speed Mode MIN. 0 1.3 MAX. 400 -- Unit kHz
s s s s s s s
ns ns ns
tHD:STA tLOW tHIGH tSU:STA tHD:DAT
4.0 4.7 4.0 4.7 5.0 0Note 2 250 -- -- 4.0 -- --
-- -- -- -- -- -- -- 1000 300 -- 400 --
0.6 1.3 0.6 0.6 -- 0Note 2 100Note 4 20 + 0.1CbNote 5 20 + 0.1CbNote 5 0.6 -- 0
-- -- -- -- -- 0.9Note 3 -- 300 300 -- 400 50
s
pF ns
Notes 1. On a start condition, the first clock pulse is generated after the hold period. 2. To fill the undefined area of the SCL0 falling edge, it is necessary for the device to internally provide an SDA0 signal (with VIHmin. of the SCL0 signal) with at least 300 ns of hold time. 3. If the device does not extend the SCL0 signal low hold time (tLOW), only the maximum data hold time tHD:DAT needs to be fulfilled. 4. The high-speed mode I2C bus is available in a standard mode I2C bus system. At this time, the conditions described below must be satisfied. * If the device does not extend the SCL0 signal low state hold time tSU:DAT 250 ns * If the device extends the SCL0 signal low state hold time Be sure to transmit the next data bit to the SDA0 line before the SCL0 line is released (tRmax. + tSU:DAT = 1000 + 250 = 1250 ns by standard mode I2C bus specification). 5. Cb: Total capacitance per bus line (unit: pF)
User's Manual U14260EJ3V1UD
517
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
A/D Converter Characteristics (TA = -40 to +85C, 2.2 V AVREF VDD 5.5 V, AVSS = VSS = 0 V)
Parameter Resolution Overall errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Conversion time tCONV 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Zero-scale errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Full-scale errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Integral linear error 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Differential linear error 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Analog input impedance During sampling Other than during sampling Analog input voltage AVREF resistance VAIN RREF During A/D conversion 0 20 40 10 AVREF 14 17 28 Symbol Conditions MIN. 10 TYP. 10 0.2 0.3 0.6 MAX. 10 0.4 0.6 1.2 96 96 96 0.4 0.6 1.2 0.4 0.6 1.2 2.5 4.5 8.5 1.5 2.0 3.5 100 Unit bit %FSR %FSR %FSR
s s s
%FSR %FSR %FSR %FSR %FSR %FSR LSB LSB LSB LSB LSB LSB k M V k
Note Overall error excluding quantization error (1/2 LSB). This value is indicated as a ratio to the full-scale value. Remark FSR: Full-scale range Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = -40 to +85C)
Parameter Data retention power supply voltage Data retention power supply current Release signal set time Oscillation stabilization wait time Symbol VDDDR Conditions MIN. 1.6 TYP. MAX. 5.5 Unit V
IDDDR
Subsystem clock stop (XT1 = VDD) and feedback resistor disconnected 0 Release by RESET Release by interrupt request
0.1
30
A s
tSREL tWAIT
217/fx Note
s s
Note Selection of 212/fX and 214/fX to 217/fX is possible using bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization time select register (OSTS).
518
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Flash Memory Programming Characteristics (TA = +10 to +40C, VDD = 2.7 to 5.5 V, VSS = AVSS = 0 V) (1) Write erase characteristics
Parameter Operating frequency Symbol fX Conditions 3.0 V VDD 5.5 V 2.7 V VDD < 3.0 V VPP supply voltage VDD supply current VPP2 IDD During flash memory programming When VPP = VPP2 fX = 8.38 MHz VDD = 5.0 V10% VDD = 3.0 V10% fX = 5.00 MHz VDD = 3.0 V10% VPP supply current Step erase time
Note 1 Note 2
MIN. 1.0 1.0 9.7
TYP.
MAX. 8.38 5.00
Unit MHz MHz V mA mA mA mA s s/area
10.0
10.3 24 17 12
IPP Ter Tera Twr
Note 3 Note 4
When VPP = VPP2 0.99 When step erase time = 1 s 50 When step write time = 100 s 1 erase + 1 write after erase = 1 rewrite
75 1.0
100 1.01 20 100 1000 20
Overall erase time per area Step write time Overall write time per word
s s
Times/area
Twrw Cerwr
Number of rewrites per area
Notes
1. The recommended setting value of the step erase time is 1 s. 2. The prewrite time before erasure and the erase verify time (writeback time) are not included. 3. The actual write time per word is 100 s longer. The internal verify time during or after a write is not included. 4. When a product is first written after shipment, "erase write" and "write only" are both taken as one rewrite. Example: P: Write, E: Erase Shipped product PEPEP: 3 rewrites Shipped product EPEPEP: 3 rewrites
(2) Serial write operation characteristics
Parameter Set time from VDD to VPP Release time from VPP to RESET VPP pulse input start time from RESET VPP pulse high-/low-level width VPP pulse input end time from RESET VPP pulse low-level input voltage VPP pulse high-level input voltage Symbol tDP tPR tRP Conditions MIN. 10 1.0 1.0 TYP. MAX. Unit
s s s s
20 ms
tPW tRPE
8.0
VPPL VPPH
0.8VDD 9.7
VDD 10.0
1.2VDD 10.3
V V
User's Manual U14260EJ3V1UD
519
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Timing Chart
AC Timing Test Points (Excluding X1, XT1 Inputs)
0.8VDD 0.2VDD
Test points
0.8VDD 0.2VDD
Clock Timing
1/fX
tXL
tXH VIH4 (MIN.) VIL4 (MAX.)
X1 input
1/fXT
tXTL XT1 input
tXTH VIH5 (MIN.) VIL5 (MAX.)
TI Timing
tTIL0 tTIH0
TI000, TI010, TI001, TI011
1/fTI5 tTIL5 tTIH5
TI50, TI51
520
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Interrupt Request Input Timing
tINTL tINTH
INTP0 to INTP3
RESET Input Timing
tRSL
RESET
User's Manual U14260EJ3V1UD
521
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Read/Write Operation External fetch (no wait):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH
Hi-Z tRDAD tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD tRDL1 tRDH
External fetch (wait insertion):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH tRDAD
Hi-Z tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD WAIT tRDWT1 tWTL tWTRD tRDL1 tRDH
522
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
External data access (no wait):
A8 to A15 tADD2 AD0 to AD7 Lower 8-bit address tADS tASTH ASTB tADH Hi-Z tRDAD tRDD2
Higher 8-bit address
Read data
Write data
Hi-Z
tRDH
RD tASTRD WR tASTWR tWRL1 tRDL2 tRDWD tWRWD tWDS tWDH tWRADH
External data access (wait insertion):
A8 to A15 tADD2 AD0 to AD7
Lower 8-bit address
Higher 8-bit address
Hi-Z Hi-Z
Read data
tRDH
Write data
tADS tADH tASTH ASTB
tRDAD tRDD2 tASTRD
RD
tRDL2
tRDWD tWRWD
tWDS
tWDH
WR
tASTWR WAIT tRDWT2 tWTL tWTRD tWRWT tWTL tWTWR tWRL1 tWRADH
User's Manual U14260EJ3V1UD
523
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Data Retention Timing (STOP Mode Release by RESET)
Internal reset operation HALT mode STOP mode Operating mode
Data retention mode
VDD
STOP instruction execution
VDDDR
tSREL
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode STOP mode Operating mode
Data retention mode
VDD STOP instruction execution Standby release signal (interrupt request)
VDDDR tSREL
tWAIT
524
User's Manual U14260EJ3V1UD
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Serial Transfer Timing 3-wire serial I/O mode:
tKCYn tKLn tKHn
SCK1, SCK3
tSIKn
tKSIn
SI1, SI3
tKSOn
Input data
SO1, SO3
Output data
Remark n = 1 to 4
UART mode (external clock input):
tKCYn t KLn tKHn
ASCK0, ASCK2
Remark n = 5, 6 I2C bus mode:
tLOW SCL0 tHD:DAT tHD:STA tHIGH tSU:DAT tF tSU:STA tHD:STA tSP tSU:STO
tR
SDA0 tBUF Stop condition Start condition Restart condition Stop condition
User's Manual U14260EJ3V1UD
525
CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y)
Flash Write Mode Setting Timing
VDD VDD 0V VPPH VPP VPPL 0V tPR tRPE VDD RESET (input) 0V Reset command SCK3
Note 1
tDP
tRP
tPW
tPW
/SCL0
Note 2
0V
VIL
SI3Note 1/RxD0Note 3
0V
VIL
SO3Note 1/TxD0Note 3/SDA0Note 2 0V
P31 (HS)Note 4
0V
Notes 1. 3-wire serial I/O (SIO3) type 2. I2C bus (IIC0) type 3. UART (UART0) type 4. Handshake (when 3-wire serial I/O (SIO3) type is used)
526
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Target products: PD780076, 780078, 780076Y, 780078Y, 78F0078, 78F0078Y for which orders were received before January 31, 2002 (Products with a rankNote K) Note The rank is indicated by the 5th digit from the left in the lot number marked on the package.
Lot number
Year code Week code Rank
Absolute Maximum Ratings (TA = 25C)
Parameter Supply voltage Symbol VDD VPP AVREF AVSS Input voltage VI1 P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, X1, X2, XT1, XT2, RESET P30 to P33 N-ch open-drain No pull-up resistor Pull-up resistor Output voltage Analog input voltage Output current, high VO VAN IOH P10 to P17 Per pin Total for P00 to P03, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 Total for P20 to P25, P30 to P36 Output current, low IOL Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Operating ambient temperature Storage temperature Tstg TA During normal operation During flash memory programming Analog input pin Conditions Ratings -0.3 to +6.5 Unit V V V V V
PD78F0078, 78F0078Y only, Note 2
-0.5 to +10.5 -0.3 to VDD + 0.3Note 1
-0.3 to +0.3 -0.3 to VDD + 0.3Note 1
VI2
-0.3 to +6.5 -0.3 to VDD + 0.3Note 1 -0.3 to VDD + 0.3Note 1 AVSS - 0.3 to AVREF + 0.3Note 1 and -0.3 to VDD + 0.3Note 1 -10 -15 -15 20 30 50 20 100 100 -40 to +85 +10 to +40 -65 to +150 -40 to +125
V V V V mA mA mA mA mA mA mA mA mA C C C C
PD780076, 780078, 780076Y, 780078Y PD78F0078, 78F0078Y
Note 1. 6.5 V or below (Note 2 is explained on the next page.) Caution Product quality may suffer if the absolute maximum rating is exceeded even momentarily for any parameter. That is, the absolute maximum ratings are rated values at which the product is on the verge of suffering physical damage, and therefore the product must be used under conditions that ensure that the absolute maximum ratings are not exceeded. Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
527
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Note 2. Make sure that the following conditions of the VPP voltage application timing are satisfied when the flash memory is written. * When supply voltage rises VPP must exceed VDD 10 s or more after VDD has reached the lower-limit value (2.7 V) of the operating voltage range (see a in the figure below). * When supply voltage drops VDD must be lowered 10 s or more after VPP falls below the lower-limit value (2.7 V) of the operating voltage range of VDD (see b in the figure below).
VDD
2.7 V 0V a b
VPP 2.7 V 0V
Capacitance (TA = 25C, VDD = VSS = 0 V)
Parameter Input capacitance I/O capacitance Symbol CIN Conditions f = 1 MHz Unmeasured pins returned to 0 V. f = 1 MHz Unmeasured pins returned to 0 V. P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 P30 to P33 MIN. TYP. MAX. 15 Unit pF
CIO
15
pF
20
pF
Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
528
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Main System Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Ceramic resonator X2 Rd C2 C1 Oscillation stabilization timeNote 2 X1 VSS1 Recommended Circuit Parameter Oscillation frequency (fX)Note 1 Conditions 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V After VDD reaches oscillation voltage range MIN. Crystal resonator X2 Rd C2 C1 X1 VSS1 Oscillation frequency Oscillation stabilization timeNote 2 External clock X2 X1 X1 input frequency (fX)Note 1 (fX)Note 1 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 1.0 1.0 50 85 1.0 1.0 8.38 5.0 10 30 8.38 5.0 500 500 ns MHz ms MHz MIN. 1.0 1.0 TYP. MAX. 8.38 5.0 4 ms Unit MHz
X1 input high-/low-level width (tXH, tXL)
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after reset or STOP mode release. Cautions 1. When using the main system clock oscillator, wire as follows in the area enclosed by the broken lines in the above figures to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. When the main system clock is stopped and the system is operating on the subsystem clock, wait until the oscillation stabilization time has been secured by the program before switching back to the main system clock.
User's Manual U14260EJ3V1UD
529
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Subsystem Clock Oscillator Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Resonator Crystal resonator Recommended Circuit
XT2 XT1 VSS1 Rd C4 C3
Parameter Oscillation frequency (fXT)Note 1 Oscillation stabilization timeNote 2 XT1 input frequency (fXT)Note 1 XT1 input high-/low-level width (tXTH, tXTL)
Conditions
MIN. 32
TYP. 32.768
MAX. 35
Unit kHz
4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 32
1.2
2 10 38.5
s
External clock
kHz
XT2
XT1
12
15
s
Notes 1. Indicates only oscillator characteristics. Refer to AC Characteristics for instruction execution time. 2. Time required to stabilize oscillation after VDD reaches oscillation voltage range MIN. Cautions 1. When using the subsystem clock oscillator, wire as follows in the area enclosed by the broken lines in the above figure to avoid an adverse effect from wiring capacitance. * Keep the wiring length as short as possible. * Do not cross the wiring with the other signal lines. * Do not route the wiring near a signal line through which a high fluctuating current flows. * Always make the ground point of the oscillator capacitor the same potential as VSS1. * Do not ground the capacitor to a ground pattern through which a high current flows. * Do not fetch signals from the oscillator. 2. The subsystem clock oscillator is designed as a low-amplitude circuit for reducing power consumption, and is more prone to malfunction due to noise than the main system clock oscillator. Particular care is therefore required with the wiring method when the subsystem clock is used.
530
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Recommended Oscillator Constant (1) PD780076, 780078, 780076Y, 780078Y (a) Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 TDK CCR3.5MC5 CCR4.0MC5 CCR4.19MC5 CCR5.0MC5 CCR6.0MC5 CCR8.0MC5 CCR8.38MC5 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 3.58 4.00 4.19 5.00 6.00 8.00 8.38 Recommended Circuit Constant C1 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 150 150 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip Rd (k) 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 1.8 1.8 1.8 2.7 2.7 3.0 3.0 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078, 780078Y Subseries within the specifications of the DC and AC characteristics.
User's Manual U14260EJ3V1UD
531
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(1) PD780076, 780078, 780076Y, 780078Y (b) Main system clock: Crystal resonator (TA = -10 to +70C)
Manufacturer Part Number Frequency (MHz) KINSEKI, Ltd. HC-49/U-S 4.19 8.38 Recommended Circuit Constant C1 (pF) 18 27 C2 (pF) 18 27 Rd (k) 4.7 0 Oscillation Voltage Range MIN. (V) 1.9 3.0 MAX. (V) 5.5 5.5
(c) Subsystem clock: Crystal resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (kHz) Seiko Epson Corporation C-022RX MC-206 MC-306 32.768 32.768 32.768 Recommended Circuit Constant C1 (pF) 15 15 15 C2 (pF) 15 15 15 Rd (k) 330 330 330 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 MAX. (V) 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078, 780078Y Subseries within the specifications of the DC and AC characteristics.
532
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(2) PD78F0078, 78F0078Y Main system clock: Ceramic resonator (TA = -40 to +85C)
Manufacturer Part Number Frequency (MHz) Murata Mfg. Co., Ltd. CSBFB1M00J58 CSBLA1M00J58 CSTCC2M00G56 CSTLS2M00G56 CSTCC3M58G53 CSTLS3M58G53 CSTCR4M00G53 CSTLS4M00G53 CSTCR4M19G53 CSTLS4M19G53 CSTCR4M91G53 CSTLS4M91G53 CSTCR5M00G53 CSTLS5M00G53 CSTCE8M00G52 CSTLS8M00G53 CSTCE8M38G52 CSTLS8M38G53 1.00 1.00 2.00 2.00 3.58 3.58 4.00 4.00 4.19 4.19 4.91 4.91 5.00 5.00 8.00 8.00 8.38 8.38 Recommended Circuit Constant C1 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip C2 (pF) 100 100 On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip On-chip R1 (k) 3.3 3.3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Oscillation Voltage Range MIN. (V) 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 1.8 2.7 2.7 3.0 3.0 3.0 3.0 MAX. (V) 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5 5.5
Caution
The oscillator constant is a reference value based on evaluation in specific environments by the resonator manufacturer. If the oscillator characteristics need to be optimized in the actual application, request the resonator manufacturer for evaluation on the implementation circuit. Note that the oscillation voltage and oscillation frequency merely indicate the characteristics of the oscillator. Use the internal operation conditions of the PD780078, 780078Y Subseries within the specifications of the DC and AC characteristics.
Remark For the resonator selection and oscillator constant, users are requested to either evaluate the oscillation themselves or apply to the resonator manufacturer for evaluation.
User's Manual U14260EJ3V1UD
533
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Output current, high Output current, low IOL Symbol IOH Per pin All pins Per pin for P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 Per pin for P30 to P33, P50 to P57 Total for P00 to P03, P40 to P47, P64 to P67, P70 to P75, P80 Total for P20 to P25 Total for P30 to P36 Total for P50 to P57 Input voltage, high VIH1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIH2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 0.8VDD 0.85VDD 0.7VDD 0.8VDD VDD - 0.5 VDD - 0.2 0.8VDD 0.9VDD 0 0 0 0 0 0 0 0 0 0 0 VDD - 1.0 VDD - 0.5 VDD VDD 5.5 5.5 VDD VDD VDD VDD 0.3VDD 0.2VDD 0.2VDD 0.15VDD 0.3VDD 0.2VDD 0.1VDD 0.4 0.2 0.2VDD 0.1VDD VDD VDD 2.0 V V V V V V V V V V V V V V V V V V V V V V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 0.7VDD 0.8VDD 15 20 10 70 70 VDD VDD mA mA mA mA mA V V Conditions MIN. TYP. MAX. -1 -15 10 Unit mA mA mA
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIH3 P30 to P33 (N-ch open-drain) VIH4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIH5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Input voltage, low VIL1 P10 to P17, P21, P24, P40 to P47, P50 to P57, P64 to P67 VIL2 P00 to P03, P20, P22, P23, P25, 2.7 V VDD 5.5 V 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V VIL4 X1, X2 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V VIL5 XT1, XT2 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V Output voltage, high Output voltage, low VOL2 P50 to P57 VOL1 VOH1 4.0 V VDD 5.5 V, IOH = -1 mA 1.8 V VDD < 4.0 V, IOH = -100 A P30 to P33 4.0 V VDD 5.5 V, IOL = 15 mA 4.0 V VDD 5.5 V, IOL = 15 mA VOL3 P00 to P03, P20 to P25, P34 to P36, P40 to P47, P64 to P67, P70 to P75, P80 VOL4 IOL = 400 A 4.0 V VDD 5.5 V, IOL = 1.6 mA 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V
P34 to P36, P70 to P75, P80, RESET 1.8 V VDD < 2.7 V VIL3 P30 to P33 (N-ch open-drain)
0.4
2.0
V
0.4
V
0.5
V
Remark
Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
534
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Input leakage current, high Symbol ILIH1 VIN = VDD Conditions P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 VIN = 5.5 V VIN = 0 V P30 to P33Note MIN. TYP. MAX. 3 Unit
A
ILIH2 ILIH3 Input leakage current, low ILIL1
20 3 -3
A A A
P00 to P03, P10 to P17, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80, RESET X1, X2, XT1, XT2 P30 to P33Note
ILIL2 ILIL3 Output leakage current, high Output leakage current, low Mask option pull-up resistance (mask ROM version only) Software pullup resistance VPP (IC) power supply voltage ILOH ILOL R1 VOUT = VDD VOUT = 0 V
-20 -3 3 -3 15 30 90
A A A A
k
VIN = 0 V, P30, P31, P32Note, P33Note
R2
VIN = 0 V, P00 to P03, P20 to P25, P34 to P36, P40 to P47, P50 to P57, P64 to P67, P70 to P75, P80 During normal operation
15
30
90
k
VPP1
0
0.2VDD
V
Note PD780076, 780078 only Remark Unless otherwise specified, the characteristics of alternate-function pins are the same as those of port pins.
User's Manual U14260EJ3V1UD
535
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (1) PD780076, 780078, 780076Y, 780078Y
Parameter Power supply currentNote 1 Symbol Conditions IDD1Note 2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 MIN. When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode 5.00 MHz crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 VDD = 3.0 V 10%Note 3 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
TYP. 5.5 6.5 2.0 3.0 0.4 1.4 1.1
MAX. 11.0 13.0 4.0 6.0 1.5 4.2 2.2 4.7
Unit mA mA mA mA mA mA mA mA mA mA mA mA
0.35
0.7 1.7
0.15
0.4 1.1
32.768 kHz crystal oscillation operating modeNote 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
40 20 10 30 6 2 0.1 0.05 0.05
80 40 20 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP
modeNote 6
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. When the main system clock and subsystem clock are stopped.
536
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
DC Characteristics (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (2) PD78F0078, 78F0078Y
Parameter Power supply currentNote 1 Symbol Conditions IDD1Note 2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation operating mode 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation operating mode VDD = 2.0 V 10%Note 4 MIN. When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating When A/D converter is stopped When A/D converter is operating IDD2 8.38 MHz VDD = 5.0 V 10%Note 3 crystal oscillation HALT mode 5.00 MHz VDD = 3.0 V 10%Note 3 crystal oscillation HALT mode VDD = 2.0 V 10%Note 4 When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating When peripheral functions are stopped When peripheral functions are operating
IDD3
TYP. 10.5 11.5 4.5 5.5 1.0 2.0 1.2
MAX. 21.0 23.0 9.0 11.0 2.0 6.0 2.4 5.0
Unit mA mA mA mA mA mA mA mA mA mA mA mA
0.4
0.8 1.7
0.2
0.4 1.1
32.768 kHz crystal oscillation operating modeNote 5
VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10% VDD = 5.0 V 10% VDD = 3.0 V 10% VDD = 2.0 V 10%
115 95 75 30 6 2 0.1 0.05 0.05
230 190 150 60 18 10 30 10 10
A A A A A A A A A
IDD4
32.768 kHz crystal oscillation HALT modeNote 5
IDD5
STOP modeNote 6
Notes 1. Total current through the internal power supply (VDD0, VDD1). 2. IDD1 includes the peripheral operating current (except the current through the pull-up resistors of ports). 3. When the processor clock control register (PCC) is set to 00H. 4. When PCC is set to 02H. 5. When main system clock operation is stopped. 6. When the main system clock and subsystem clock are stopped.
User's Manual U14260EJ3V1UD
537
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
AC Characteristics (1) Basic operation (TA = -40 to +85C, VDD = 1.8 to 5.5 V)
Parameter Cycle time (Min. instruction execution time) Symbol TCY Operating with main system clock Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V Operating with subsystem clock TI000, TI010, TI001, TI011 input high-/lowlevel width TI50, TI51 input frequency TI50, TI51 input high-/low-level width Interrupt request input high-/lowlevel width RESET low-level width tRSL tINTH, tINTL tTIH5, tTIL5 fTI5 tTIH0, tTIL0 3.5 V VDD 5.5 V 2.7 V VDD < 3.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V INTP0 to INTP3, P40 to P47 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V 2.7 V VDD 5.5 V 1.8 V VDD < 2.7 V MIN. 0.238 0.4 1.6 103.9Note 1 2/fsam + 2/fsam + 0.1Note 2 0.2Note 2 122 TYP. MAX. 16 16 16 125 Unit
s s s s s s s
2/fsam + 0.5Note 2 0 0 100 1.8 1 2 10 20 4 275
MHz kHz ns
s s s s s
Notes 1. Value when the external clock is used. When a crystal resonator is used, it is 114 s (MIN.). 2. Selection of fsam = fX, fX/4, fX/64 is possible using bits 0 and 1 (PRM000, PRM010) of prescaler mode register 00 (PRM00). Selection of fsam = fX/2, fX/8, fX/512 is possible using bits 0 and 1 (PRM001, PRM011) of prescaler mode register 01 (PRM01). However, if the TI000 or TI001 valid edge is selected as the count clock, the value becomes fsam = fX/8.
538
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
TCY vs. VDD (main system clock operation)
16.0 10.0
Cycle time TCY [ s]
5.0
Operation guaranteed range
2.0 1.6 1.0
0.4 0.238 0.1 0 1.0 1.8 2.0 2.7 Supply voltage VDD [V] 3.0 4.0 5.0 5.5 6.0
User's Manual U14260EJ3V1UD
539
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(2) Read/write operation (TA = -40 to +85C, VDD = 4.0 to 5.5 V) (1/3)
Parameter ASTB high-level width Address setup time Address hold time Data input time from address Symbol tASTH tADS tADH tADD1 tADD2 Address output time from RD Data input time from RD tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Address hold time from RD at external fetch Write data output time from RD Write data output time from WR Address hold time from WR Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 10 0.8tCY - 15 0.8tCY 0.8tCY 60 1.2tCY + 30 2.5tCY + 25 2.5tCY + 25 ns ns ns ns ns tRDADH 0.8tCY - 15 1.2tCY + 30 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + n)tCY + 10 60 6 (1.5 + 2n)tCY - 15 6 2tCY - 15 0.8tCY - 15 1.2tCY 0 (1.5 + 2n)tCY - 33 (2.5 + 2n)tCY - 33 tCY - 43 tCY - 43 tCY - 25 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 20 6 (2 + 2n)tCY - 54 (3 + 2n)tCY - 60 100 (2 + 2n)tCY - 87 (3 + 2n)tCY - 93 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Remarks
1. 2. 3.
tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
540
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(2) Read/write operation (TA = -40 to +85C, VDD = 2.7 to 4.0 V) (2/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 20 0.8tCY - 30 0.5tCY 0.5tCY 120 1.2tCY + 60 2.5tCY + 50 2.5tCY + 50 ns ns ns ns ns tRDADH 0.8tCY - 30 1.2tCY + 60 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 10 (1.5 + 2n)tCY - 30 10 2tCY - 30 0.8tCY - 30 1.2tCY 0 (1.5 + 2n)tCY - 40 (2.5 + 2n)tCY - 40 tCY - 75 tCY - 60 tCY - 50 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 30 10 (2 + 2n)tCY - 108 (3 + 2n)tCY - 120 200 (2 + 2n)tCY - 148 (3 + 2n)tCY - 162 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Remarks
1. 2. 3.
tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
User's Manual U14260EJ3V1UD
541
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(2) Read/write operation (TA = -40 to +85C, VDD = 1.8 to 2.7 V) (3/3)
Parameter ASTB high-level width Address setup time Address hold time Input time from address to data Symbol tASTH tADS tADH tADD1 tADD2 Output time from RD to address Input time from RD to data tRDAD tRDD1 tRDD2 Read data hold time RD low-level width tRDH tRDL1 tRDL2 Input time from RD to WAIT tRDWT1 tRDWT2 Input time from WR to WAIT WAIT low-level width Write data setup time Write data hold time WR low-level width Delay time from ASTB to RD Delay time from ASTB to WR Delay time from RD to ASTB at external fetch Hold time from RD to address at external fetch Write data output time from RD Write data output time from WR Hold time from WR to address Delay time from WAIT to RD Delay time from WAIT to WR tRDWD tWRWD tWRADH tWTRD tWTWR 40 40 0.8tCY - 60 0.5tCY 0.5tCY 240 1.2tCY + 120 2.5tCY + 100 2.5tCY + 100 ns ns ns ns ns tRDADH 0.8tCY - 60 1.2tCY + 120 ns tWRWT tWTL tWDS tWDH tWRL1 tASTRD tASTWR tRDAST (0.5 + 2n)tCY + 10 60 20 (1.5 + 2n)tCY - 60 20 2tCY - 60 0.8tCY - 60 1.2tCY 0 (1.5 + 2n)tCY - 92 (2.5 + 2n)tCY - 92 tCY - 350 tCY - 132 tCY - 100 (2 + 2n)tCY 0 Conditions MIN. 0.3tCY 120 20 (2 + 2n)tCY - 233 (3 + 2n)tCY - 240 400 (2 + 2n)tCY - 325 (3 + 2n)tCY - 332 MAX. Unit ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Remarks
1. 2. 3.
tCY = TCY/4 n indicates the number of waits. CL = 100 pF (CL indicates the load capacitance of the AD0 to AD7, A8 to A15, RD, WR, WAIT, and ASTB pins.)
542
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(3) Serial interface (TA = -40 to +85C, VDD = 1.8 to 5.5 V) (a) SIO3 3-wire serial I/O mode (SCK3 ... Internal clock output)
Parameter SCK3 cycle time Symbol tKCY1 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width SI3 setup time (to SCK3) tSIK1 tKH1, tKL1 4.0 V VDD 5.5 V 1.8 V VDD < 4.0 V 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSO1 C = 100 pF
Note
MIN. 954 1600 3200 tKCY1/2 - 50 tKCY1/2 - 100 100 150 300 400
TYP.
MAX.
Unit ns ns ns ns ns ns ns ns ns
tKSI1
300
ns
Note C is the load capacitance of the SCK3 and SO3 output lines. (b) SIO3 3-wire serial I/O mode (SCK3 ... External clock input)
Parameter SCK3 cycle time Symbol tKCY2 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK3 high-/ low-level width tKH2, tKL2 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI3 setup time (to SCK3) SI3 hold time (from SCK3) Delay time from SCK3 to SO3 output tKSI2
Note
MIN. 800 1600 3200 400 800 1600 100
TYP.
MAX.
Unit ns ns ns ns ns ns ns
tSIK2
400
ns
tKSO2
C = 100 pF
300
ns
Note C is the load capacitance of the SO3 output line.
User's Manual U14260EJ3V1UD
543
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(c) CSI1 3-wire serial I/O mode (SCK1 ... Internal clock output)
Parameter SCK1 cycle time Symbol tKCY3 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH3, tKL3 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tSIK3 MIN. 200 500 1 tKCY3/2 - 5 tKCY3/2 - 20 tKCY3/2 - 30 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSI3 C = 100 pFNote
110
ns
tKSO3
150
ns
Note C is the load capacitance of the SCK1 and SO1 output lines. (d) CSI1 3-wire serial I/O mode (SCK1 ... External clock input)
Parameter SCK1 cycle time Symbol tKCY4 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SCK1 high-/low-level width tKH4, tKL4 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V SI1 setup time (to SCK1) SI1 hold time (from SCK1) Delay time from SCK1 to SO1 output tKSI4 C = 100 pFNote 110 ns tSIK4 MIN. 200 500 1 100 250 500 25 TYP. MAX. Unit ns ns
s
ns ns ns ns
tKSO4
150
ns
Note C is the load capacitance of the SO1 output line.
(e) UART0 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 131031 78125 39063 Unit bps bps bps
544
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(f)
UART0 (external clock input)
Parameter Symbol tKCY5 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 39063 19531 9766 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK0 cycle time
ASCK0 high-/low-level width
tKH5, tKL5
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
(g) UART0 (infrared data transfer mode)
Parameter Transfer rate Bit rate tolerance Output pulse width Input pulse width Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 131031 0.87 0.24/fbrNote Unit bps %
s s
Note fbr: Specified baud rate (h) UART2 (dedicated baud rate generator output)
Parameter Transfer rate Symbol Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. TYP. MAX. 262062 156250 62500 Unit bps bps bps
(i)
UART2 (external clock input)
Parameter Symbol tKCY6 Conditions 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V MIN. 800 1600 3200 400 800 1600 78125 39063 19531 TYP. MAX. Unit ns ns ns ns ns ns bps bps bps
ASCK2 cycle time
ASCK2 high-/low-level width
tKH6, tKL6
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
Transfer rate
4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V 1.8 V VDD < 2.7 V
User's Manual U14260EJ3V1UD
545
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
(j)
UART2 (infrared data transfer mode)
Parameter Symbol Conditions 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 4.0 V VDD 5.5 V 1.2 4/fX MIN. TYP. MAX. 262062 0.87 0.24/fbrNote Unit bps %
Transfer rate Bit rate tolerance Output pulse width Input pulse width
s s
Note fbr: Specified baud rate (k) I2C bus mode (PD780076Y, 780078Y, 78F0078Y only)
Standard Mode Parameter SCL0 clock frequency Bus free time (between stop and start condition) Hold timeNote 1 SCL0 clock low-level width SCL0 clock high-level width Start/restart condition setup time Data hold time CBUS compatible master I2C bus Data setup time SDA0 and SCL0 signal rise time SDA0 and SCL0 signal fall time Stop condition setup time Capacitive load per each bus line Spike pulse width controlled by input filter tSU:DAT tR tF tSU:STO Cb tSP Symbol fSCL tBUF MIN. 0 4.7 MAX. 100 -- High-Speed Mode MIN. 0 1.3 MAX. 400 -- Unit kHz
s s s s s s s
ns ns ns
tHD:STA tLOW tHIGH tSU:STA tHD:DAT
4.0 4.7 4.0 4.7 5.0 0Note 2 250 -- -- 4.0 -- --
-- -- -- -- -- -- -- 1000 300 -- 400 --
0.6 1.3 0.6 0.6 -- 0Note 2 100Note 4 20 + 0.1CbNote 5 20 + 0.1CbNote 5 0.6 -- 0
-- -- -- -- -- 0.9Note 3 -- 300 300 -- 400 50
s
pF ns
Notes 1. On a start condition, the first clock pulse is generated after the hold period. 2. To fill the undefined area of the SCL0 falling edge, it is necessary for the device to internally provide an SDA0 signal (with VIHmin. of the SCL0 signal) with at least 300 ns of hold time. 3. If the device does not extend the SCL0 signal low hold time (tLOW), only the maximum data hold time tHD:DAT needs to be fulfilled. 4. The high-speed mode I2C bus is available in a standard mode I2C bus system. At this time, the conditions described below must be satisfied. * If the device does not extend the SCL0 signal low state hold time tSU:DAT 250 ns * If the device extends the SCL0 signal low state hold time Be sure to transmit the next data bit to the SDA0 line before the SCL0 line is released (tRmax. + tSU:DAT = 1000 + 250 = 1250 ns by standard mode I2C bus specification). 5. Cb: Total capacitance per bus line (unit: pF)
546
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
A/D Converter Characteristics (TA = -40 to +85C, 2.2 V AVREF VDD 5.5 V, AVSS = VSS = 0 V)
Parameter Resolution Overall errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Conversion time tCONV 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Zero-scale errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Full-scale errorNote 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Integral linear error 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Differential linear error 4.0 V AVREF 5.5 V 2.7 V AVREF < 4.0 V 2.2 V AVREF < 2.7 V Analog input impedance During sampling Other than during sampling Analog input voltage AVREF resistance VAIN RREF During A/D conversion 0 20 40 10 AVREF 14 19 28 Symbol Conditions MIN. 10 TYP. 10 0.2 0.3 0.6 MAX. 10 0.4 0.6 1.2 96 96 96 0.4 0.6 1.2 0.4 0.6 1.2 2.5 4.5 8.5 1.5 2.0 3.5 100 Unit bit %FSR %FSR %FSR
s s s
%FSR %FSR %FSR %FSR %FSR %FSR LSB LSB LSB LSB LSB LSB k M V k
Note Overall error excluding quantization error (1/2 LSB). This value is indicated as a ratio to the full-scale value. Remark FSR: Full-scale range Data Memory STOP Mode Low Supply Voltage Data Retention Characteristics (TA = -40 to +85C)
Parameter Data retention power supply voltage Data retention power supply current Release signal set time Oscillation stabilization wait time Symbol VDDDR Conditions MIN. 1.6 TYP. MAX. 5.5 Unit V
IDDDR
Subsystem clock stop (XT1 = VDD) and feedback resistor disconnected 0 Release by RESET Release by interrupt request
0.1
30
A s
tSREL tWAIT
2 /fx Note
17
s s
Note Selection of 212/fX and 214/fX to 217/fX is possible using bits 0 to 2 (OSTS0 to OSTS2) of the oscillation stabilization time select register (OSTS).
User's Manual U14260EJ3V1UD
547
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Flash Memory Programming Characteristics (TA = +10 to +40C, VDD = 2.7 to 5.5 V, VSS = AVSS = 0 V) (1) Write erase characteristics
Parameter Operating frequency Symbol fX 4.0 V VDD 5.5 V 2.7 V VDD < 4.0 V VPP supply voltage VDD supply current VPP2 IDD During flash memory programming When VPP = VPP2 VPP supply current Step erase time
Note 1
Conditions
MIN. 1.0 1.0 9.7
TYP.
MAX. 8.38 5.00
Unit MHz MHz V mA mA mA s s/area
10.0
10.3 24 12
fX = 8.38 MHz fX = 5.00 MHz
VDD = 5.0 V 10% VDD = 3.0 V 10% 75 0.99 1.0
IPP Ter Tera Twr Twrw Cerwr
When VPP = VPP2
100 1.01 20
Overall erase time per Note 2 area Step write time Overall write time per Note 3 word Number of rewrites per Note 4 area
When step erase time = 1 s 50 When step write time = 100 s 1 erase + 1 write after erase = 1 rewrite
100 1000 20
s s
Times/area
Notes 1. 2. 3. 4.
The recommended setting value of the step erase time is 1 s. The prewrite time before erasure and the erase verify time (writeback time) are not included. The actual write time per word is 100 s longer. The internal verify time during or after a write is not included. When a product is first written after shipment, "erase write" and "write only" are both taken as one rewrite. Example: P: Write, E: Erase Shipped product PEPEP: 3 rewrites Shipped product EPEPEP: 3 rewrites
(2) Serial write operation characteristics
Parameter Set time from VDD to VPP Release time from VPP to RESET VPP pulse input start time from RESET VPP pulse high-/low-level width VPP pulse input end time from RESET VPP pulse low-level input voltage VPP pulse high-level input voltage Symbol tDP tPR tRP Conditions MIN. 10 1.0 1.0 TYP. MAX. Unit
s s s s
20 ms
tPW tRPE
8.0
VPPL VPPH
0.8VDD 9.7
VDD 10.0
1.2VDD 10.3
V V
548
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Timing Chart
AC Timing Test Points (Excluding X1, XT1 Inputs)
0.8VDD 0.2VDD
Test points
0.8VDD 0.2VDD
Clock Timing
1/fX
tXL
tXH VIH4 (MIN.) VIL4 (MAX.)
X1 input
1/fXT
tXTL XT1 input
tXTH VIH5 (MIN.) VIL5 (MAX.)
TI Timing
tTIL0 tTIH0
TI000, TI010, TI001, TI011
1/fTI5 tTIL5 tTIH5
TI50, TI51
User's Manual U14260EJ3V1UD
549
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Interrupt Request Input Timing
tINTL tINTH
INTP0 to INTP3
RESET Input Timing
tRSL
RESET
550
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Read/Write Operation External fetch (no wait):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH
Hi-Z tRDAD tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD tRDL1 tRDH
External fetch (wait insertion):
A8 to A15
Higher 8-bit address tADD1
AD0 to AD7
Lower 8-bit address tADS tASTH tADH tRDAD
Hi-Z tRDD1
Instruction code tRDADH tRDAST
ASTB
RD tASTRD WAIT tRDWT1 tWTL tWTRD tRDL1 tRDH
User's Manual U14260EJ3V1UD
551
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
External data access (no wait):
A8 to A15 tADD2 AD0 to AD7 Lower 8-bit address tADS tASTH ASTB tADH Hi-Z tRDAD tRDD2
Higher 8-bit address
Read data
Write data
Hi-Z
tRDH
RD tASTRD WR tASTWR tWRL1 tRDL2 tRDWD tWRWD tWDS tWDH tWRADH
External data access (wait insertion):
A8 to A15 tADD2 AD0 to AD7
Lower 8-bit address
Higher 8-bit address
Hi-Z Hi-Z
Read data
tRDH
Write data
tADS tADH tASTH ASTB
tRDAD tRDD2 tASTRD
RD
tRDL2
tRDWD tWRWD
tWDS
tWDH
WR
tASTWR WAIT tRDWT2 tWTL tWTRD tWRWT tWTL tWTWR tWRL1 tWRADH
552
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Data Retention Timing (STOP Mode Release by RESET)
Internal reset operation HALT mode STOP mode Operating mode
Data retention mode
VDD
STOP instruction execution
VDDDR
tSREL
RESET
tWAIT
Data Retention Timing (Standby Release Signal: STOP Mode Release by Interrupt Request Signal)
HALT mode STOP mode Operating mode
Data retention mode
VDD STOP instruction execution Standby release signal (interrupt request)
VDDDR tSREL
tWAIT
User's Manual U14260EJ3V1UD
553
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Serial Transfer Timing 3-wire serial I/O mode:
tKCYn tKLn tKHn
SCK1, SCK3
tSIKn
tKSIn
SI1, SI3
tKSOn
Input data
SO1, SO3
Output data
Remark n = 1 to 4
UART mode (external clock input):
tKCYn t KLn tKHn
ASCK0, ASCK2
Remark n = 5, 6 I2C bus mode ( PD780076Y, 780078Y, 78F0078Y only):
tLOW SCL0 tHD:DAT tHD:STA tHIGH tSU:DAT tF tSU:STA tHD:STA tSP tSU:STO
tR
SDA0 tBUF Stop condition Start condition Restart condition Stop condition
554
User's Manual U14260EJ3V1UD
CHAPTER 27
ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS)
Flash Write Mode Setting Timing
VDD VDD 0V VPPH VPP VPPL 0V tPR tRPE VDD RESET (input) 0V Reset command SCK3
Note 1
tDP
tRP
tPW
tPW
/SCL0
Note 2
0V
VIL
SI3Note 1/RxD0Note 3
0V
VIL
SO3Note 1/TxD0Note 3/SDA0Note 2 0V
P31 (HS)Note 4
0V
Notes 1. 3-wire serial I/O (SIO3) type 2. I2C bus (IIC0) type (PD78F0078Y only) 3. UART (UART0) type 4. Handshake (when 3-wire serial I/O (SIO3) type is used)
User's Manual U14260EJ3V1UD
555
CHAPTER 28
PACKAGE DRAWINGS
64-PIN PLASTIC LQFP (14x14)
A B
48 49
33 32
detail of lead end S P C D
T
R 64 1 F G H I
M
L U
17 16 Q
J
ITEM A B
MILLIMETERS 17.20.2 14.00.2 14.00.2 17.20.2 1.0 1.0 0.37 +0.08 -0.07 0.20 0.8 (T.P.) 1.60.2 0.8 0.17 +0.03 -0.06 0.10 1.40.1 0.1270.075 +4 3 -3 1.7 MAX. 0.25 0.8860.15 P64GC-80-8BS
K S
C D F G H
N
S
M
I J K
NOTE Each lead centerline is located within 0.20 mm of its true position (T.P.) at maximum material condition.
L M N P Q R S T U
Remark The external dimensions and materials of the ES version are the same as those of the mass-produced version.
556
User's Manual U14260EJ3V1UD
CHAPTER 28
PACKAGE DRAWINGS
64-PIN PLASTIC QFP (14x14)
A B
48 49
33 32
detail of lead end S CD Q R
64 1
17 16
F G H I
M
J
P
K S
N
S
L M
NOTE Each lead centerline is located within 0.15 mm of its true position (T.P.) at maximum material condition.
ITEM A B C D F G H I J K L M N P Q R S
MILLIMETERS 17.60.4 14.00.2 14.00.2 17.60.4 1.0 1.0 0.37 +0.08 -0.07 0.15 0.8 (T.P.) 1.80.2 0.80.2 0.17 +0.08 -0.07 0.10 2.550.1 0.10.1 55 2.85 MAX. P64GC-80-AB8-5
Remark The external dimensions and materials of the ES version are the same as those of the mass-produced version.
User's Manual U14260EJ3V1UD
557
CHAPTER 28
PACKAGE DRAWINGS
64-PIN PLASTIC TQFP (12x12)
A B
48 49
33 32 S P
detail of lead end
T C D R
L U
64 1 F G H I
M
17 16
Q
J
ITEM A B MILLIMETERS 14.00.2 12.00.2 12.00.2 14.00.2 1.125 1.125 0.32 +0.06 -0.10 0.13 0.65 (T.P.) 1.00.2 0.5 0.17 +0.03 -0.07 0.10 1.0 0.10.05 3 +4 -3 1.10.1 0.25 0.60.15 P64GK-65-9ET-3
K S M N
NOTE Each lead centerline is located within 0.13 mm of its true position (T.P.) at maximum material condition.
C D F G H I J K L M N P Q R S T U
S
Remark The external dimensions and materials of the ES version are the same as those of the mass-produced version.
558
User's Manual U14260EJ3V1UD
CHAPTER 29
RECOMMENDED SOLDERING CONDITIONS
The PD780078, 780078Y Subseries should be soldered and mounted under the following recommended conditions. For soldering methods and conditions other than those recommended below, contact an NEC Electronics sales representative. For technical information, see the following website. Semiconductor Device Mount Manual (http://www.necel.com/pkg/en/mount/index.html) Table 29-1. Surface Mounting Type Soldering Conditions (1/2) (1) PD780076GC-xxx-8BS: 64-pin plastic LQFP (14 x 14) 64-pin plastic LQFP (14 x 14)
PD780078GC-xxx-8BS:
PD780076YGC-xxx-8BS: 64-pin plastic LQFP (14 x 14) PD780078YGC-xxx-8BS: 64-pin plastic LQFP (14 x 14) PD78F0078GC-8BS: PD78F0078YGC-8BS: PD780076GC-xxx-AB8: PD780078GC-xxx-AB8:
64-pin plastic LQFP (14 x 14) 64-pin plastic LQFP (14 x 14) 64-pin plastic QFP (14 x 14) 64-pin plastic QFP (14 x 14)
PD780076YGC-xxx-AB8: 64-pin plastic QFP (14 x 14) PD780078YGC-xxx-AB8: 64-pin plastic QFP (14 x 14)
Soldering Method Soldering Conditions Recommended Condition Symbol IR35-00-2
Infrared reflow
Package peak temperature: 235C, Time: 30 seconds max. (at 210C or higher), Count: Two times or less
VPS
Package peak temperature: 215C, Time: 40 seconds max. (at 200C or higher), Count: Two times or less Solder bath temperature: 260C max., Time: 10 seconds max., Count: Once, Preheating temperature: 120C max. (package surface temperature) Pin temperature: 300C max., Time: 3 seconds max. (per pin row)
VP15-00-2
Wave soldering
WS60-00-1
Partial heating
--
Caution
Do not use different soldering methods together (except for partial heating). 64-pin plastic QFP (14 x 14) 64-pin plastic QFP (14 x 14)
Soldering Conditions Recommended Condition Symbol IR35-00-3
(2) PD78F0078GC-AB8:
PD78F0078YGC-AB8:
Soldering Method
Infrared reflow
Package peak temperature: 235C, Time: 30 seconds max. (at 210C or higher), Count: Three times or less Package peak temperature: 215C, Time: 40 seconds max. (at 200C or higher), Count: Three times or less Solder bath temperature: 260C max., Time: 10 seconds max., Count: Once, Preheating temperature: 120C max. (package surface temperature) Pin temperature: 300C max., Time: 3 seconds max. (per pin row)
VPS
VP15-00-3
Wave soldering
WS60-00-1
Partial heating
--
Caution
Do not use different soldering methods together (except for partial heating).
User's Manual U14260EJ3V1UD
559
CHAPTER 29
RECOMMENDED SOLDERING CONDITIONS
Table 29-1. Surface Mounting Type Soldering Conditions (2/2) (3) PD780076GK-xxx-9ET: 64-pin plastic TQFP (12 x 12) 64-pin plastic TQFP (12 x 12)
PD780078GK-xxx-9ET:
PD780076YGK-xxx-9ET: 64-pin plastic TQFP (12 x 12) PD780078YGK-xxx-9ET: 64-pin plastic TQFP (12 x 12)
Soldering Method Soldering Conditions Recommended Condition Symbol IR35-107-2
Infrared reflow
Package peak temperature: 235C, Time: 30 seconds max. (at 210C or higher), Count: Two times or less, Exposure limit: 7 daysNote (after that, prebake at 125C for 10 hours) Package peak temperature: 215C, Time: 40 seconds max. (at 200C or higher), Count: Two times or less, Exposure limit: 7 daysNote (after that, prebake at 125C for 10 hours) Solder bath temperature: 260C max., Time: 10 seconds max., Count: Once, Preheating temperature: 120C max. (package surface temperature), Exposure limit: 7 daysNote (after that, prebake at 125C for 10 hours)
VPS
VP15-107-2
Wave soldering
WS60-107-1
Partial heating
Pin temperature: 300C max., Time: 3 seconds max. (per pin row)
--
Note After opening the dry pack, store it at 25C or less and 65% RH or less for the allowable storage period. Caution Do not use different soldering methods together (except for partial heating). 64-pin plastic TQFP (12 x 12) 64-pin plastic TQFP (12 x 12)
Soldering Conditions Recommended Condition Symbol IR35-103-2
(4) PD78F0078GK-9ET:
PD78F0078YGK-9ET:
Soldering Method
Infrared reflow
Package peak temperature: 235C, Time: 30 seconds max. (at 210C or higher), Count: Two times or less, Exposure limit: 3 daysNote (after that, prebake at 125C for 10 hours)
VPS
Package peak temperature: 215C, Time: 40 seconds max. (at 200C or higher), Count: Two times or less, Exposure limit: 3 daysNote (after that, prebake at 125C for 10 hours) Solder bath temperature: 260C max., Time: 10 seconds max., Count: Once, Preheating temperature: 120C max. (package surface temperature), Exposure limit: 3 daysNote (after that, prebake at 125C for 10 hours) Pin temperature: 300C max., Time: 3 seconds max. (per pin row)
VP15-103-2
Wave soldering
WS60-103-1
Partial heating
--
Note After opening the dry pack, store it at 25C or less and 65% RH or less for the allowable storage period. Caution Do not use different soldering methods together (except for partial heating).
560
User's Manual U14260EJ3V1UD
APPENDIX A
DIFFERENCES BETWEEN PD78018F, 780024A, 780034A, AND 780078 SUBSERIES
Tables A-1 and A-2 show the major differences between the PD78018F, 780024A, 780034A, and 780078 Subseries. Table A-1. Major Differences Between PD78018F, 780024A, 780034A, and 780078 Subseries (Hardware)
Name Item EMI noise reduction Internal I2C bus version (Y subseries) PROM version Flash memory version ROM Internal high-speed RAM Internal expansion RAM Minimum instruction execution time Number of I/O ports Timer Not provided Provided Provided Provided (multi-master supported)
PD78018F SubseriesNote
PD780024A, 780034A
Subseries
PD780078 Subseries
PD78P018F
Not provided 8 KB to 60 KB 512, 1024 bytes 512, 1024 bytes 0.4 s (10 MHz) 53 16 bits: 1, 8 bits: 2, Watch timer: 1, Watchdog timer: 1 8 bits x 8
Not provided
PD78F0034A, 78F0034B
8 KB to 32 KB 512, 1024 bytes Not provided
PD78F0078
48 KB, 60 KB 1024 bytes 1024 bytes
0.24 s (8.38 MHz), 0.16 s (12 MHz, expanded-specification products only) 51 16 bits: 1, 8 bits: 2, Watch timer: 1, Watchdog timer: 1 * 8 bits x 8 (PD780024A Subseries) * 10 bits x 8 (PD780034A Subseries) 3-wire: 2, UART: 1 52 16 bits: 2, 8 bits: 2, Watch timer: 1, Watchdog timer: 1 10 bits x 8
A/D converter
Serial interface operating mode
Subseries without suffix Y
3-wire/2-wire/SBI: 1, 3-wire (automatic transmission/reception): 1 3-wire/2-wire/I2C: 1, 3-wire (automatic transmission/reception): 1 3 (14-bit PWM output possible: 2)
3-wire: 1, UART: 1, 3-wire/UART: 1
Subseries with suffix Y
3-wire: 2, UART: 1, Multi-master I2C: 1
3-wire: 1, UART: 1, 3-wire/UART: 1, Multi-master I2C: 1 4 (8-bit PWM output possible: 2)
Timer output Package
3 (8-bit PWM output possible: 2)
* 64-pin SDIP (19.05 mm (750)) * 64-pin SDIP (19.05 mm (750)) * 64-pin QFP (14 x 14) * 64-pin QFP (14 x 14) * 64-pin QFP (14 x 14) * 64-pin TQFP (12 x 12) * 64-pin LQFP (12 x 12) * 64-pin TQFP (12 x 12) * 64-pin LQFP (14 x 14) * 64-pin LQFP (14 x 14) * 64-pin LQFP (10 x 10) * 73-pin FBGA (9 x 9) DF78014 IE-78014-R-EM-A, IE-78018-NS-EM1 DF780034 IE-780034-NS-EM1 DF780078 IE-780078-NS-EM1
Device file Emulation board
Electrical specifications Recommended soldering conditions
Refer to the data sheet or user's manual (with electrical specifications) of each product.
Note Maintenance product
User's Manual U14260EJ3V1UD
561
APPENDIX A
DIFFERENCES BETWEEN PD78018F, 780024A, 780034A, AND 780078 SUBSERIES
Table A-2. Major Differences Between PD78018F, 780024A, 780034A, and 780078 Subseries (Software) (1/2)
Name Item A/D converter --
PD78018F SubseriesNote 1
PD780024A, 780034A
Subseries
PD780078 Subseries
Take the appropriate measures for the first A/D conversion result immediately after the A/D conversion operation is started (ADCS0 is set to 1), such as discarding it, because it may not satisfy the rating. However, if a wait time of 14 s (MIN.) has been secured after ADCE0 was set to 1 before starting operation (ADCS0 is set to 1), the first data can be used.
16-bit timer/event counter
1 ch TM0
1 ch TM0
2 ch TM00 TM01
Interval timer PWM output PPG output Pulse width measurement External event counter Square wave output Count clock
-- --
--
fX/2, fX/22, fX/23, TI0
fX, fX/22, fX/26, TI00
fX, fX/22, fX/26, TI000 TMC00 TOC00 CR000, CR010 PRM00 CRC00
fX/2, fX/23 fX/29, TI001 TMC01 TOC01 CR001, CR011 PRM01 CRC01
Control register Output control register Compare/capture register Prescaler mode register Capture/compare control register Interrupt
TMC0 TOC0 CR00, CR01 (Capture only) TCL0Note 2 --
TMC0 TOC0 CR00, CR01 PRM0 CRC0
INTTM0
INTTM00, INTTM01
INTTM000, INTTM010
INTTM001, INTTM011
Notes 1. Maintenance product 2. TCL0: Timer clock select register 0
562
User's Manual U14260EJ3V1UD
APPENDIX A
DIFFERENCES BETWEEN PD78018F, 780024A, 780034A, AND 780078 SUBSERIES
Table A-2. Major Differences Between PD78018F, 780024A, 780034A, and 780078 Subseries (Software) (2/2)
Name Item 8-bit timer/event counter 2 ch TM1 Unit mode Interval timer External event counter Square wave output PWM output Cascade connection mode Interval timer External event counter Square wave output Count clock fX/22, fX/23, fX/24, fX/25, fX/26, fX/27, fX/28, fX/29, fX/210, fX212, TI1 TMC1 TOC1 TCL1 INTTM1 INTTM2 fX/22, fX/23, fX/24, fX/25, fX/26, fX/27, fX/28, fX/29, fX/210, fX/212, TI2 fX, fX/22, fX/24, fX/26, fX/28, fX/210, TI50 fX/2, fX/23, fX/25, fX/27, fX/29, fX/211, TI51 TM2 2 ch TM50 TM51
PD78018F SubseriesNote
PD780024A, 780034A
Subseries
PD780078 Subseries
--
Control register Output control register Clock select register Interrupt
TMC50 TMC50 TCL50 INTTM50
TMC51 TMC51 TCL51 INTTM51
Note Maintenance product
User's Manual U14260EJ3V1UD
563
APPENDIX B
DEVELOPMENT TOOLS
The following development tools are available for the development of systems that employ the PD780078 and 780078Y Subseries. Figure B-1 shows the development tool configuration.
*
Support for PC98-NX series Unless otherwise specified, products compatible with IBM PC/ATTM computers are compatible with PC98-NX series computers. When using PC98-NX series computers, refer to the explanation for IBM PC/AT computers.
*
Windows Unless otherwise specified, "Windows" means the following OSs. * Windows 3.1 * Windows 95 * Windows 98 * Windows 2000 * Windows NTTM Ver.4.0
564
User's Manual U14260EJ3V1UD
APPENDIX B
DEVELOPMENT TOOLS
Figure B-1. Development Tool Configuration (1/2) (1) When using the in-circuit emulator IE-78K0-NS or IE-78K0-NS-A
Software package * Software package
Language processing software * Assembler package * C compiler package * Device file * C library source fileNote 1
Debugging software * Integrated debugger * System simulator
Control software * Project manager (Windows only)Note 2
Host machine (PC or EWS) Interface adapter, PC card interface, etc.
Power supply unit
Flash memory write environment Flash programmer
In-circuit emulator Emulation board
Flash memory write adapter
I/O board
Flash memory
Performance board
Emulation probe
Conversion socket or conversion adapter Target system
Notes 1. The C library source file is not included in the software package. 2. The project manager is included in the assembler package. The project manager is only used for Windows.
User's Manual U14260EJ3V1UD
565
APPENDIX B
DEVELOPMENT TOOLS
Figure B-1. Development Tool Configuration (2/2) (2) When using the in-circuit emulator IE-78001-R-A
Software package * Software package
Language processing software * Assembler package * C compiler package * Device file * C compiler source fileNote 1
Debugging software * Integrated debugger * System simulator
Control software * Project manager (Windows only)Note 2
Host machine (PC or EWS) Interface adapter, PC card interface, etc.
Flash memory write environment Flash programmer
In-circuit emulator Emulation board Emulation probe conversion board I/O board
Flash memory write adapter
Flash memory
Performance board
Emulation probe
Conversion socket or conversion adapter Target system
Notes 1. The C library source file is not included in the software package. 2. The project manager is included in the assembler package. The project manager is only used for Windows.
566
User's Manual U14260EJ3V1UD
APPENDIX B
DEVELOPMENT TOOLS
B.1 Software Package
SP78K0 Software package This package contains various software tools for 78K/0 Series development. The following tools are included. RA78K0, CC78K0, ID78K0-NS, SM78K0, and various device files Part Number: SxxxxSP78K0
Remark xxxx in the part number differs depending on the OS used.
SxxxxSP78K0
xxxx AB17 BB17 Host Machine PC-9800 series, IBM PC/AT compatibles OS Windows (Japanese version) Windows (English version) Supply Medium CD-ROM
B.2 Language Processing Software
RA78K0 Assembler package This assembler converts programs written in mnemonics into object codes executable with a microcontroller. Further, this assembler is provided with functions capable of automatically creating symbol tables and branch instruction optimization. This assembler should be used in combination with device file (DF780078) (sold separately). This assembler package is a DOS-based application. It can also be used in Windows, however, by using the project manager (included in the assembler package) on Windows. Part Number: SxxxxRA78K0 CC78K0 C compiler package This compiler converts programs written in C language into object codes executable with a microcontroller. This compiler should be used in combination with an assembler package and device file (both sold separately). This C compiler package is a DOS-based application. It can also be used in Windows, however, by using the project manager (included in the assembler package) on Windows. Part Number: SxxxxCC78K0 DF780078Note 1 Device file This file contains information peculiar to the device. This device file should be used in combination with tool (RA78K0, CC78K0, SM78K0, ID78K0-NS, and RX78K0) (all sold separately). The corresponding OS and host machine differ depending on the tool used. Part Number: SxxxxDF780078 CC78K0-LNote 2 C library source file This is a source file of functions configuring the object library included in the C compiler package. This file is required to match the object library included in C compiler package to the user's specifications. It does not depend on the operating environment because it is a source file. Part Number: SxxxxCC78K0-L
Notes 1. The DF780078 can be used in common with the RA78K0, CC78K0, SM78K0, ID78K0-NS, and RX78K0. 2. CC78K0-L is not included in the software package (SP78K0).
User's Manual U14260EJ3V1UD
567
APPENDIX B
DEVELOPMENT TOOLS
Remark xxxx in the part number differs depending on the host machine and OS used.
SxxxxRA78K0 SxxxxCC78K0
xxxx AB13 BB13 AB17 BB17 3P17 3K17 HP9000 series 700TM Host Machine PC-9800 series, IBM PC/AT compatibles OS Windows (Japanese version) Windows (English version) Windows (Japanese version) Windows (English version) HP-UXTM (Rel. 10.10) SunOSTM (Rel. 4.1.4), SolarisTM (Rel. 2.5.1) CD-ROM Supply Medium 3.5-inch 2HD FD
SPARCstationTM
SxxxxDF780078 SxxxxCC78K0-L
xxxx AB13 BB13 3P16 3K13 3K15 Host Machine PC-9800 series, IBM PC/AT compatibles HP9000 series 700 SPARCstation OS Windows (Japanese version) Windows (English version) HP-UX (Rel. 10.10) SunOS (Rel. 4.1.4), Solaris (Rel. 2.5.1) DAT 3.5-inch 2HD FD 1/4-inch CGMT Supply Medium 3.5-inch 2HD FD
B.3 Control Software
Project manager This is control software designed to enable efficient user program development in the Windows environment. All operations used in development of a user program, such as starting the editor, building, and starting the debugger, can be performed from the project manager. The project manager is included in the assembler package (RA78K0). It can only be used in Windows.
B.4 Flash Memory Writing Tools
Flashpro III (part number: FL-PR3, PG-FP3) Flashpro IV (part number: FL-PR4, PG-FP4) Flash programmer FA-64GC-8BS-A FA-64GC FA-64GK-9ET Flash memory writing adapter Flash programmer dedicated to microcontrollers with on-chip flash memory.
Flash memory writing adapter used connected to the Flashpro III and Flashpro IV. * FA-64GC-8BS-A: 64-pin plastic LQFP (GC-8BS type) * FA-64GC: 64-pin plastic QFP (GC-AB8 type) * FA-64GK-9ET: 64-pin plastic TQFP (GK-9ET type)
Remark FL-PR3, FL-PR4, FA-64GC-8BS-A, FA-64GC, and FA-64GK-9ET are products of Naito Densei Machida Mfg. Co., Ltd. Contact: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd.
568
User's Manual U14260EJ3V1UD
APPENDIX B
DEVELOPMENT TOOLS
B.5 Debugging Tools (Hardware)
B.5.1 When using the in-circuit emulator IE-78K0-NS or IE-78K0-NS-A
IE-78K0-NS In-circuit emulator The in-circuit emulator serves to debug hardware and software when developing application systems using a 78K/0 Series product. It corresponds to the integrated debugger (ID78K0-NS). This emulator should be used in combination with a power supply unit, emulation probe, and interface adapter which is required to connect this emulator to the host machine. This board is connected to the IE-78K0-NS to expand its functions. Adding this board adds a coverage function and enhances debugging functions such as tracer and timer functions. A combination of the IE-78K0-NS and IE-78K0-NS-PA. This adapter is used for supplying power from a receptacle of 100 V to 240 V AC. This adapter is required when using a PC-9800 series computer (except notebook type) as the host machine (C bus compatible). This is PC card and interface cable required when using a notebook-type computer as the host machine (PCMCIA socket compatible). This adapter is required when using an IBM PC/AT compatible computer as the host machine (ISA bus compatible). This adapter is required when using a computer with a PCI bus as the host machine. This board emulates the operations of the peripheral hardware peculiar to a device. It should be used in combination with an in-circuit emulator. This probe is used to connect the in-circuit emulator to a target system and is designed for use with a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type).
IE-78K0-NS-PA Performance board IE-78K0-NS-A In-circuit emulator IE-70000-MC-PS-B Power supply unit IE-70000-98-IF-C Interface adapter IE-70000-CD-IF-A PC card interface IE-70000-PC-IF-C Interface adapter IE-70000-PCI-IF-A Interface adapter IE-780078-NS-EM1 Emulation board NP-64GC Emulation probe
This conversion socket connects the NP-64GC to a target system board designed for EV-9200GC-64 a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type). Conversion socket (See Figures B-2 and B-3) NP-64GC-TQ NP-H64GC-TQ Emulation probe TGC-064SAP Conversion adapter NP-64GK NP-H64GK-TQ Emulation probe TGK-064SBW Conversion adapter (See Figure B-4) This probe is used to connect the in-circuit emulator to a target system and is designed for use with a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type). This conversion adapter connects the NP-64GC-TQ or NP-H64GK-TQ to a target system board designed for a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type). This probe is used to connect the in-circuit emulator to a target system and is designed for use with a 64-pin plastic TQFP (GK-9ET type). This conversion adapter connects the NP-64GK or NP-H64GK-TQ to a target system board designed for a 64-pin plastic TQFP (GK-9ET type).
Remarks 1. NP-64CW, NP-64GC, NP-64GC-TQ, NP-H64GC-TQ, NP-64GK, and NP-H64GK-TQ are products of Naito Densei Machida Mfg. Co., Ltd. Contact: +81-45-475-4191 Naito Densei Machida Mfg. Co., Ltd. 2. TGK-064SBW and TGC-064SAP are products of TOKYO ELETECH CORPORATION. Contact: Daimaru Kogyo, Ltd. Phone: Tokyo +81-3-3820-7112 Electronics Dept. Osaka +81-6-6244-6672 Electronics 2nd Dept. 3. EV-9200GC-64 is sold in five-unit sets. 4. TGK-064SBW and TGC-064SAP are sold in single units.
User's Manual U14260EJ3V1UD
569
APPENDIX B
DEVELOPMENT TOOLS
B.5.2 When using the in-circuit emulator IE-78001-R-A
IE-78001-R-A In-circuit emulator The in-circuit emulator serves to debug hardware and software when developing application systems using a 78K/0 Series product. It corresponds to the integrated debugger (ID78K0). This emulator should be used in combination with an emulation probe and interface adapter, which is required to connect this emulator to the host machine. This adapter is required when using a PC-9800 series computer (except notebook type) as the host machine (C bus compatible). This adapter is required when using an IBM PC/AT compatible computer as the host machine (ISA bus compatible). This adapter is required when using a computer with a PCI bus as the host machine.
IE-70000-98-IF-C Interface adapter IE-70000-PC-IF-C Interface adapter IE-70000-PCI-IF-A Interface adapter IE-780078-NS-EM1 Emulation board
This board emulates the operations of the peripheral hardware peculiar to a device. It should be used in combination with an in-circuit emulator and emulation probe conversion board. This board is required when using the IE-780078-NS-EM1 on the IE-78001-R-A.
IE-78K0-R-EX1 Emulation probe conversion board EP-78240GC-RNote Emulation probe
This probe is used to connect the in-circuit emulator to a target system and is designed for use with a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type). This conversion socket connects the EP-78240GC-R to a target system board designed for a 64-pin plastic QFP (GC-AB8 type) and 64-pin plastic LQFP (GC-8BS type). This probe is used to connect the in-circuit emulator to a target system and is designed for use with a 64-pin plastic TQFP (GK-9ET type). This conversion adapter connects the EP-78012GK-R to a target system board designed for a 64-pin plastic TQFP (GK-9ET type).
EV-9200GC-64 Conversion socket (See Figures B-2 and B-3) EP-78012GK-R Emulation probe TGK-064SBW Conversion adapter (See Figure B-4)
Note Maintenance product Remarks 1. TGK-064SBW is a product of TOKYO ELETECH CORPORATION. Contact: Daimaru Kogyo, Ltd. Phone: Tokyo +81-3-3820-7112 Electronics Dept. Osaka +81-6-6244-6672 Electronics 2nd Dept. 2. EV-9200GC-64 is sold in five-unit sets. 3. TGK-064SBW is sold in single units.
570
User's Manual U14260EJ3V1UD
APPENDIX B
DEVELOPMENT TOOLS
B.6 Debugging Tools (Software)
SM78K0 System simulator This is a system simulator for the 78K/0 Series. The SM78K0 is Windows-based software. It is used to perform debugging at the C source level or assembler level while simulating the operation of the target system on a host machine. Use of the SM78K0 allows the execution of application logical testing and performance testing on an independent basis from hardware development, thereby providing higher development efficiency and software quality. The SM78K0 should be used in combination with the device file (DF780078) (sold separately). Part Number: SxxxxSM78K0 ID78K0-NS Integrated debugger (supporting in-circuit emulators IE-78K0-NS and IE-78K0-NS-A) ID78K0 Integrated debugger (supporting in-circuit emulator IE-78001-R-A) This debugger supports the in-circuit emulators for the 78K/0 Series. The ID78K0-NS is Windows-based software. It has improved C-compatible debugging functions and can display the results of tracing with the source program using an integrating window function that associates the source program, disassemble display, and memory display with the trace result. It should be used in combination with the device file (sold separately). Part Number: SxxxxID78K0-NS, SxxxxID78K0
Remark xxxx in the part number differs depending on the host machine and OS used.
SxxxxSM78K0 SxxxxID78K0-NS SxxxxID78K0
xxxx AB13 BB13 AB17 BB17 Host Machine IBM PC/AT compatibles OS Windows (Japanese version) Windows (English version) Windows (Japanese version) Windows (English version) CD-ROM Supply Medium 3.5-inch 2HD FD
User's Manual U14260EJ3V1UD
571
APPENDIX B
DEVELOPMENT TOOLS
Conversion Socket (EV-9200GC-64) Package Drawing and Recommended Board Mounting Pattern Figure B-2. EV-9200GC-64 Package Drawing (for Reference Only)
A E B F M
R
N
O
D
C
S T K
Q
EV-9200GC-64-G0E INCHES 0.74 0.555 0.555 0.74 4-C 0.118 0.031 0.236 0.622 0.728 0.236 0.622 0.728 0.315 0.307 0.098 0.079 0.053 0.014 +0.004 -0.005
EV-9200GC-64
1 No.1 pin index P
G H I ITEM A B C D E F G H I J K L M N O P Q R S T MILLIMETERS 18.8 14.1 14.1 18.8 4-C 3.0 0.8 6.0 15.8 18.5 6.0 15.8 18.5 8.0 7.8 2.5 2.0 1.35 0.35 0.1
J
2.3 1.5
0.091 0.059
572
User's Manual U14260EJ3V1UD
L
APPENDIX B
DEVELOPMENT TOOLS
Figure B-3. EV-9200GC-64 Recommended Board Mounting Pattern (for Reference Only)
G
J K
D
E
F
L
C B A EV-9200GC-64-P1E ITEM A B C D E F G H I J K L MILLIMETERS 19.5 14.8 0.8-0.02 x 15=12.0-0.05 INCHES 0.768 0.583 0.031+0.002 x --0.001 0.591=0.472 +0.003 --0.002
0.8-0.02 x 15=12.0-0.05 0.031+0.002 x 0.591=0.472 +0.003 --0.001 --0.002 14.8 19.5 6.00 - 0.08 6.00 - 0.08 0.5 - 0.02 0.583 0.768 0.236 +0.004 --0.003 0.236 +0.004 --0.003 0.197 +0.001 --0.002
2.36 - 0.03 2.2 - 0.1 1.57 - 0.03
0.093 +0.001 --0.002 0.087 +0.004 --0.005 0.062 +0.001 --0.002
Caution
Dimensions of mount pad for EV-9200 and that for target device (QFP) may be different in some parts. For the recommended mount pad dimensions for QFP, refer to "Semiconductor Device Mount Manual" (http://www.necel.com/pkg/en/mount/index. html).
I
H
User's Manual U14260EJ3V1UD
573
APPENDIX B
DEVELOPMENT TOOLS
Conversion Adapter (TGK-064SBW) Package Drawing Figure B-4. TGK-064SBW Package Drawing (for Reference Only)
K
A B C
L M S
Protrusion height
X
T
U
V
GFED
HI
J
Q
W R
Z e d c b f Y k j i
a
N O P h
g
ITEM A B C D E F G H I J K L M N O P Q R S T U V W X Y Z MILLIMETERS 18.4 0.65x15=9.75 0.65 7.75 10.15 12.55 14.95 0.65x15=9.75 11.85 18.4 C 2.0 12.45 10.25 7.7 10.02 14.92 11.1 1.45 1.45 4- 1.3 1.8 5.0 INCHES 0.724 0.026x0.591=0.384 0.026 0.305 0.400 0.494 0.589 0.026x0.591=0.384 0.467 0.724 C 0.079 0.490 0.404 0.303 0.394 0.587 0.437 0.057 0.057 4- 0.051 0.071 0.197 ITEM a b c d e f g h i j k MILLIMETERS INCHES
0.3
1.85 3.5 2.0 3.9 1.325 1.325 5.9 0.8 2.4 2.7
0.012
0.073 0.138 0.079 0.154 0.052 0.052 0.232 0.031 0.094 0.106 TGK-064SBW-G1E
5.3
4-C 1.0
0.209
4-C 0.039
3.55 0.9
0.140 0.035
Note Product by TOKYO ELETECH CORPORATION.
574
User's Manual U14260EJ3V1UD
APPENDIX C
NOTES ON TARGET SYSTEM DESIGN
The following shows the conditions when connecting the emulation probe and conversion adapter. Consider the shape of the components to be mounted on the target system and follow the configurations below when designing the system. Among the products described in this appendix, NP-64GC-TQ, NP-H64GC-TQ, NP-64GK, and NP-H64GK-TQ are products of Naito Densei Machida Mfg. Co., Ltd. and TGC-064SAP and TGK-064SBW are products of TOKYO ELETECH CORPORATION. Table C-1. Distance Between IE System and Conversion Adapter
Emulation Probe NP-64GC-TQ NP-H64GC-TQ NP-64GK NP-H64GK-TQ TGK-064SBW Conversion Adapter TGC-064SAP Distance Between IE System and Conversion Adapter 170 mm 370 mm 170 mm 370 mm
User's Manual U14260EJ3V1UD
575
APPENDIX C
NOTES ON TARGET SYSTEM DESIGN
Figure C-1. Distance Between In-Circuit Emulator and Conversion Adapter (64GC)
In-circuit emulator IE-78K0-NS or IE-78K0-NS-A Target system Emulation board IE-780078-NS-EM1 170 mm
Note
Emulation probe NP-64GC-TQ, NP-H64GC-TQ
Conversion adapter: TGC-064SAP
Note The above distance shows when the NP-64GC-TQ is used. When the NP-H64GC-TQ is used, the distance is 370 mm. Figure C-2. Connection Conditions of Target System (NP-64GC-TQ)
Emulation board IE-780078-NS-EM1 Emulation probe NP-64GC-TQ
23 mm
Conversion adapter TGC-064SAP 11 mm 25 mm 20.65 mm 40 mm Pin 1 20.65 mm 34 mm
Target system
576
User's Manual U14260EJ3V1UD
APPENDIX C
NOTES ON TARGET SYSTEM DESIGN
Figure C-3. Connection Conditions of Target System (NP-H64GC-TQ)
Emulation board IE-780078-NS-EM1 Emulation probe NP-H64GC-TQ
23 mm
Conversion adapter TGC-064SAP 11 mm 23 mm 20.65 mm 42 mm Pin 1 20.65 mm 45 mm
Target system
User's Manual U14260EJ3V1UD
577
APPENDIX C
NOTES ON TARGET SYSTEM DESIGN
Figure C-4. Distance Between In-Circuit Emulator and Conversion Adapter (64GK)
In-circuit emulator IE-78K0-NS or IE-78K0-NS-A Target system Emulation board IE-780078-NS-EM1 170 mm
Note
Emulation probe NP-64GK, NP-H64GK-TQ
Conversion adapter TGK-064SBW
Note The above distance shows when the NP-64GK is used. When the NP-H64GK-TQ is used, the distance is 370 mm. Figure C-5. Connection Conditions of Target System (NP-64GK)
Emulation board IE-780078-NS-EM1 Emulation probe NP-64GK
21.95 mm
Conversion adapter TGK-064SBW 11 mm 25 mm 18.4 mm 40 mm Pin 1 18.4 mm 34 mm
Target system
578
User's Manual U14260EJ3V1UD
APPENDIX C
NOTES ON TARGET SYSTEM DESIGN
Figure C-6. Connection Conditions of Target System (NP-H64GK-TQ)
Emulation board IE-780078-NS-EM1 Emulation probe NP-H64GK-TQ
21.95 mm
Conversion adapter TGK-064SBW
11 mm
23 mm
18.4 mm
Pin 1
18.4 mm
42 mm
45 mm
Target system
User's Manual U14260EJ3V1UD
579
APPENDIX D
REGISTER INDEX
D.1 Register Index (In Alphabetical Order with Respect to Register Names) [A]
A/D conversion result register 0 (ADCR0) ... 231 A/D converter mode register 0 (ADM0) ... 228 Analog input channel specification register 0 (ADS0) ... 231 Asynchronous serial interface mode register 0 (ASIM0) ... 250 Asynchronous serial interface mode register 2 (ASIM2) ... 272 Asynchronous serial interface status register 0 (ASIS0) ... 252 Asynchronous serial interface status register 2 (ASIS2) ... 274 Asynchronous serial interface transmit status register 2 (ASIF2) ... 275
[B]
Baud rate generator control register 0 (BRGC0) ... 252 Baud rate generator control register 2 (BRGC2) ... 276
[C]
Capture/compare control register 00 (CRC00) ... 151 Capture/compare control register 01 (CRC01) ... 151 Clock output select register (CKS) ... 221 Clock select register 2 (CKSEL2) ... 277
[E]
8-bit timer compare register 50 (CR50) ... 190 8-bit timer compare register 51 (CR51) ... 190 8-bit timer counter 50 (TM50) ... 189 8-bit timer counter 51 (TM51) ... 189 8-bit timer mode control register 50 (TMC50) ... 192 8-bit timer mode control register 51 (TMC51) ... 192 External interrupt falling edge enable register (EGN) ... 404 External interrupt rising edge enable register (EGP) ... 404
[I]
IIC control register 0 (IICC0) ... 338 IIC shift register 0 (IIC0) ... 336 IIC status register 0 (IICS0) ... 343 IIC transfer clock select register 0 (IICCL0) ... 346 Internal expansion RAM size switching register (IXS) ... 440 Interrupt mask flag register 0H (MK0H) ... 402 Interrupt mask flag register 0L (MK0L) ... 402 Interrupt mask flag register 1L (MK1L) ... 402 Interrupt request flag register 0H (IF0H) ... 401 Interrupt request flag register 0L (IF0L) ... 401 Interrupt request flag register 1L (IF1L) ... 401
580
User's Manual U14260EJ3V1UD
APPENDIX D
REGISTER INDEX
[M]
Memory expansion mode register (MEM) ... 418 Memory expansion wait setting register (MM) ... 419 Memory size switching register (IMS) ... 439
[O]
Oscillation stabilization time select register (OSTS) ... 132, 427
[P]
Port mode register 0 (PM0) ... 118 Port mode register 2 (PM2) ... 118, 254, 322 Port mode register 3 (PM3) ... 118, 280, 313, 347 Port mode register 4 (PM4) ... 118 Port mode register 5 (PM5) ... 118 Port mode register 6 (PM6) ... 118 Port mode register 7 (PM7) ... 118, 157, 195, 223 Port mode register 8 (PM8) ... 118, 322 Port register 0 (P0) ... 122 Port register 1 (P1) ... 122 Port register 2 (P2) ... 122 Port register 3 (P3) ... 122 Port register 4 (P4) ... 122 Port register 5 (P5) ... 122 Port register 6 (P6) ... 122 Port register 7 (P7) ... 122 Port register 8 (P8) ... 122 Prescaler mode register 00 (PRM00) ... 155 Prescaler mode register 01 (PRM01) ... 155 Priority specification flag register 0H (PR0H) ... 403 Priority specification flag register 0L (PR0L) ... 403 Priority specification flag register 1L (PR1L) ... 403 Processor clock control register (PCC) ... 129 Program status word (PSW) ... 72, 405 Pull-up resistor option register 0 (PU0) ... 123 Pull-up resistor option register 2 (PU2) ... 123 Pull-up resistor option register 3 (PU3) ... 123 Pull-up resistor option register 4 (PU4) ... 123 Pull-up resistor option register 5 (PU5) ... 123 Pull-up resistor option register 6 (PU6) ... 123 Pull-up resistor option register 7 (PU7) ... 123 Pull-up resistor option register 8 (PU8) ... 123
[R]
Receive buffer register 0 (RXB0) ... 249 Receive buffer register 2 (RXB2) ... 270
User's Manual U14260EJ3V1UD
581
APPENDIX D
REGISTER INDEX
[S]
Serial clock select register 1 (CSIC1) ... 321 Serial I/O shift register 1 (SIO1) ... 319 Serial I/O shift register 3 (SIO3) ... 311 Serial operation mode register 1 (CSIM1) ... 320 Serial operation mode register 3 (CSIM3) ... 311 16-bit timer capture/compare register 000 (CR000) ... 145 16-bit timer capture/compare register 001 (CR001) ... 145 16-bit timer capture/compare register 010 (CR010) ... 147 16-bit timer capture/compare register 011 (CR011) ... 147 16-bit timer counter 00 (TM00) ... 145 16-bit timer counter 01 (TM01) ... 145 16-bit timer mode control register 00 (TMC00) ... 148 16-bit timer mode control register 01 (TMC01) ... 148 16-bit timer output control register 00 (TOC00) ... 153 16-bit timer output control register 01 (TOC01) ... 153 Slave address register 0 (SVA0) ... 336
[T]
Timer clock select register 50 (TCL50) ... 191 Timer clock select register 51 (TCL51) ... 191 Transfer mode specification register 2 (TRMC2) ... 279 Transmit buffer register 1 (SOTB1) ... 319 Transmit buffer register 2 (TXB2) ... 270 Transmit shift register 0 (TXS0) ... 249
[W]
Watch timer operation mode register (WTM) ... 211 Watchdog timer clock select register (WDCS) ... 216 Watchdog timer mode register (WDTM) ... 217
582
User's Manual U14260EJ3V1UD
APPENDIX D
REGISTER INDEX
D.2 Register Index (In Alphabetical Order with Respect to Register Symbol) [A]
ADCR0: A/D conversion result register 0 ... 231 ADM0: ADS0: ASIF2: ASIM0: ASIM2: ASIS0: ASIS2: A/D converter mode register 0 ... 228 Analog input channel specification register 0 ... 231 Asynchronous serial interface transmit status register 2 ... 275 Asynchronous serial interface mode register 0 ... 250 Asynchronous serial interface mode register 2 ... 272 Asynchronous serial interface status register 0 ... 252 Asynchronous serial interface status register 2 ... 274
[B]
BRGC0: Baud rate generator control register 0 ... 252 BRGC2: Baud rate generator control register 2 ... 276
[C]
CKS: CR000: CR001: CR010: CR011: CR50: CR51: CRC00: CRC01: CSIC1: CSIM1: CSIM3: Clock output select register ... 221 16-bit timer capture/compare register 000 ... 145 16-bit timer capture/compare register 001 ... 145 16-bit timer capture/compare register 010 ... 147 16-bit timer capture/compare register 011 ... 147 8-bit timer compare register 50 ... 190 8-bit timer compare register 51 ... 190 Capture/compare control register 00 ... 151 Capture/compare control register 01 ... 151 Serial clock select register 1 ... 321 Serial operation mode register 1 ... 320 Serial operation mode register 3 ... 311 CKSEL2: Clock select register 2 ... 277
[E]
EGN: EGP: External interrupt falling edge enable register ... 404 External interrupt rising edge enable register ... 404
[I]
IF0H: IF0L: IF1L: IIC0: IICC0: IICCL0: IICS0: IMS: IXS: Interrupt request flag register 0H ... 401 Interrupt request flag register 0L ... 401 Interrupt request flag register 1L ... 401 IIC shift register 0 ... 336 IIC control register 0 ... 338 IIC transfer clock select register 0 ... 346 IIC status register 0 ... 343 Memory size switching register ... 439 Internal expansion RAM size switching register ... 440
User's Manual U14260EJ3V1UD
583
APPENDIX D
REGISTER INDEX
[M]
MEM: MK0H: MK0L: MK1L: MM: Memory expansion mode register ... 418 Interrupt mask flag register 0H ... 402 Interrupt mask flag register 0L ... 402 Interrupt mask flag register 1L ... 402 Memory expansion wait setting register ... 419
[O]
OSTS: Oscillation stabilization time select register ... 132, 427
[P]
P0: P1: P2: P3: P4: P5: P6: P7: P8: PCC: PM0: PM2: PM3: PM4: PM5: PM6: PM7: PM8: PR0H: PR0L: PR1L: Port register 0 ... 122 Port register 1 ... 122 Port register 2 ... 122 Port register 3 ... 122 Port register 4 ... 122 Port register 5 ... 122 Port register 6 ... 122 Port register 7 ... 122 Port register 8 ... 122 Processor clock control register ... 129 Port mode register 0 ... 118 Port mode register 2 ... 118, 254, 322 Port mode register 3 ... 118, 280, 313, 347 Port mode register 4 ... 118 Port mode register 5 ... 118 Port mode register 6 ... 118 Port mode register 7 ... 118, 157, 195, 223 Port mode register 8 ... 118, 322 Priority specification flag register 0H ... 403 Priority specification flag register 0L ... 403 Priority specification flag register 1L ... 403
PRM00: Prescaler mode register 00 ... 155 PRM01: Prescaler mode register 01 ... 155 PSW: PU0: PU2: PU3: PU4: PU5: PU6: PU7: PU8: Program status word ... 72, 405 Pull-up resistor option register 0 ... 123 Pull-up resistor option register 2 ... 123 Pull-up resistor option register 3 ... 123 Pull-up resistor option register 4 ... 123 Pull-up resistor option register 5 ... 123 Pull-up resistor option register 6 ... 123 Pull-up resistor option register 7 ... 123 Pull-up resistor option register 8 ... 123
[R]
RXB0: RXB2: Receive buffer register 0 ... 249 Receive buffer register 2 ... 270
584
User's Manual U14260EJ3V1UD
APPENDIX D
REGISTER INDEX
[S]
SIO1: SIO3: SOTB1: SVA0: Serial I/O shift register 1 ... 319 Serial I/O shift register 3 ... 311 Transmit buffer register 1 ... 319 Slave address register 0 ... 336
[T]
TCL50: TCL51: TM00: TM01: TM50: TM51: TMC00: TMC01: TMC50: TMC51: TOC00: TOC01: TXB2: TXS0: Timer clock select register 50 ... 191 Timer clock select register 51 ... 191 16-bit timer counter 00 ... 145 16-bit timer counter 01 ... 145 8-bit timer counter 50 ... 189 8-bit timer counter 51 ... 189 16-bit timer mode control register 00 ... 148 16-bit timer mode control register 01 ... 148 8-bit timer mode control register 50 ... 192 8-bit timer mode control register 51 ... 192 16-bit timer output control register 00 ... 153 16-bit timer output control register 01 ... 153 Transmit buffer register 2 ... 270 Transmit shift register 0 ... 249
TRMC2: Transfer mode specification register 2 ... 279
[W]
WDCS: WDTM: WTM: Watchdog timer clock select register ... 216 Watchdog timer mode register ... 217 Watch timer operation mode register ... 211
User's Manual U14260EJ3V1UD
585
APPENDIX E REVISION HISTORY
E.1 Major Revisions in This Edition
(1/3)
Page U14260EJ3V0UD00 U14260EJ3V1UD00 p. 360 p. 366 pp. 443, 444 Modification of Figure 18-18 Communication Reservation Timing Modification of Figure 18-21 Master Operation Flowchart (5/5) Division of Note in previous edition of Figure 23-5 Example of Connection with Dedicated Flash Programmer to Notes 1 and 2 and modification of contents Addition of description on voltage monitoring of dedicated flash programmer to in 23.3.3 On-board pin processing U14260EJ2V0UD00 U14260EJ3V0UD00 Throughout Addition of expanded-specification products to PD780078Y Subseries Modification of name of the following special function registers (SFR) * Ports 0 to 8 Port registers 0 to 8 p. 29 p. 78 p. 110 p. 112 p. 113 p. 114 p. 118 Addition of 2.1 Expanded-Specification Products and Conventional Products Modification of value after reset of port register 1 (P1) in Table 5-3 Special Function Register List Modification of Figure 6-14 Block Diagram of P40 to P47 Modification of Figure 6-16 Block Diagram of P50 to P57 Modification of Figure 6-17 Block Diagram of P64, P65, and P67 Modification of Figure 6-18 Block Diagram of P66 Addition of port registers (P0 to P8) to 6.3 Port Function Control Registers Addition of the following figures * Figure 8-3 Format of 16-Bit Timer Counter 0n (TM0n) * Figure 8-4 Format of 16-Bit Timer Capture/Compare Register 00n (CR00n) * Figure 8-5 Format of 16-Bit Timer Capture/Compare Register 01n (CR01n) Addition of register setting method to the following sections * 8.4.1 Interval timer operation * 8.4.2 External event counter operation * 8.4.3 Pulse width measurement operations * 8.4.4 Square-wave output operation * 8.4.5 PPG output operation Addition of settings of prescaler mode register 0n (PRM0n) to the following figures * Figure 8-15 Control Register Settings for Interval Timer Operation * Figure 8-19 Control Register Settings in External Event Counter Mode (with Rising Edge Specified) * Figure 8-23 Control Register Settings for Pulse Width Measurement with Free-Running Counter and One Capture Register (When TI00n and CR01n Are Used) * Figure 8-26 Control Register Settings for Measurement of Two Pulse Widths with Free-Running Counter * Figure 8-28 Control Register Settings for Pulse Width Measurement with Free-Running Counter and Two Capture Registers (with Rising Edge Specified) * Figure 8-30 Control Register Settings for Pulse Width Measurement by Means of Restart (with Rising Edge Specified) * Figure 8-32 Control Register Settings in Square-Wave Output Mode * Figure 8-34 Control Register Settings for PPG Output Operation Description
p. 447
p. 145 p. 145 p. 147
p. p. p. p. p.
158 161 163 171 173
p. 158 p. 161 p. 164 p. 166 p. 168 p. 170 p. 172 p. 174
586
User's Manual U14260EJ3V1UD
APPENDIX E
REVISION HISTORY
(2/3)
Page Description Modification of the following figures * Figure 8-17 Timing of Interval Timer Operation * Figure 8-36 PPG Output Operation Timing * Figure 8-37 Start Timing of 16-Bit Timer Counter 0n (TM0n) Addition of the following figures * Figure 9-3 Format of 8-Bit Timer Counter 5n (TM5n) * Figure 9-4 Format of 8-Bit Timer Compare Register 5n (CR5n) Modification of the following figures * Figure 9-10 Interval Timer Operation Timing * Figure 9-11 External Event Counter Operation Timing (with Rising Edge Specified) * Figure 9-12 Square-Wave Output Operation Timing * Figure 9-13 PWM Output Operation Timing * Figure 9-14 Timing of Operation with CR5n Changed * Figure 9-15 16-Bit Resolution Cascade Connection Mode * Figure 9-16 Start Timing of 8-Bit Timer Counter 5n (TM5n) Modification of description on cycle and duty, and addition of active level width to 9.4.4 8-bit PWM output operation Addition of 10.5 Cautions for Watch Timer and Figure 10-4 Example of Generation of Watch Timer Interrupt Request (INTWT) (When Interrupt Period = 0.5 s) p. 225 p. 226 p. 228 Modification of Figure 13-1 Block Diagram of 10-Bit A/D Converter Modification of part of description in 13.2 A/D Converter Configuration Shift of description of A/D conversion result register 0 (ADCR0) to 13.3 Registers Used in A/D Converter p. 232 p. 234 Modification of part of description in 13.4.1 Basic operations of A/D converter Addition of description of successive approximation register (SAR) to 13.4.2 Input voltage and conversion results Modification of the following figures * Figure 13-9 A/D Conversion by Hardware Start (When Falling Edge Is Specified) * Figure 13-10 A/D Conversion by Software Start * Figure 13-17 A/D Conversion End Interrupt Request Generation Timing Modification of part of description in (10) Timing at which A/D conversion result is undefined in 13.6 Cautions for A/D Converter Addition of Figure 13-20 Timing of A/D Converter Sampling and A/D Conversion Start Delay Modification of description in (1) Registers to be used in 14.4.2 Asynchronous serial interface (UART) mode Addition of Figure 14-9 Example of UART Transmit/Receive Data Waveform Modification of Table 14-4 Causes of Receive Errors Modification of description in (1) Registers to be used in 14.4.3 Infrared data transfer mode Modification of description in (1) Registers to be used in 15.4.2 Asynchronous serial interface (UART) mode Addition of Figure 15-12 Example of UART Transmit/Receive Data Waveform Modification of Table 15-9 Causes of Receive Errors Modification of description in (1) Registers to be used in 15.4.3 Multi-processor transfer mode Modification of description in (1) Registers to be used in 15.4.4 Infrared data transfer (IrDA) mode
p. 159 p. 175 p. 183
p. 189 p. 190
pp. 196 to 198 p. 199 p. 201 p. 203 p. 204 p. 205 p. 209 p. 202
p. 214
p. 236 p. 237 p. 242 p. 243
p. 245 p. 255
p. 259 p. 263 p. 264 p. 282
p. 287 p. 295 p. 297 p. 303
User's Manual U14260EJ3V1UD
587
APPENDIX E
REVISION HISTORY
(3/3)
Page p. 315 p. 317 p. 319 p. 321 p. 324 p. 331 pp. 362 to 366 p. 367 p. 404 p. 406 Description Modification of description in (1) Registers to be used in 16.4.2 3-wire serial I/O mode Modification of Table 16-3 Register Settings Partial modification of Figure 17-1 Block Diagram of Serial Interface CSI1 Partial modification of Figure 17-3 Format of Serial Clock Select Register 1 (CSIC1) Modification of description in (1) Registers to be used in 17.4.2 3-wire serial I/O mode Addition of (5) SO1 output to 17.4.2 3-wire serial I/O mode Modification of Figure 18-21 Master Operation Flowchart Modification of (2) Slave operation in 18.5.15 Communication operations Addition of Table 19-3 Ports Corresponding to EGPn and EGNn Modification of part of description in 19.4.1 Non-maskable interrupt request acknowledgment operation p. 409 p. 419 Modification of part of description in 19.4.2 Maskable interrupt request acknowledgment operation Addition of Note to Figure 20-2 Format of Memory Expansion Mode Register (MEM) and addition of Figure 20-3 Pins Specified for Address (with PD780076 and 780076Y) Partial modification of Table 23-3 Communication Mode List Revision of CHAPTER 25 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076, 780078, 78F0078) Addition of CHAPTER 26 ELECTRICAL SPECIFICATIONS (EXPANDED-SPECIFICATION PRODUCTS OF PD780076Y, 780078Y, 78F0078Y) Revision of CHAPTER 27 ELECTRICAL SPECIFICATIONS (CONVENTIONAL PRODUCTS) Partial modification of Table 29-1 Surface Mounting Type Soldering Conditions Deletion of B.7 Embedded Software and B.8 System Upgrade from Former In-circuit Emulator for 78K/0 Series to IE-78001-R-A in the previous edition
p. 442 p. 467
p. 498
p. 527 p. 559 pp. 564, 565 in previous edition
588
User's Manual U14260EJ3V1UD
APPENDIX E
REVISION HISTORY
E.2 Revision History up to Previous Edition
The history of revisions made up to this edition is shown below. (1/4)
Edition 2nd Contents Addition of the following package * 64-pin plastic LQFP (GC-8BS type) Addition of expanded-specification products to the PD780078 Subseries Addition of 1.1 Expanded-Specification Products and Conventional Products Modification of voltage operation range of A/D converter in 1.8 Outline of Functions Modification of voltage operation range of A/D converter in 2.7 Outline of Functions CHAPTER 2 OUTLINE (PD780078Y SUBSERIES) CHAPTER 3 PIN FUNCTION (PD780078 SUBSERIES) CHAPTER 1 OUTLINE (PD780078 SUBSERIES) Applied to: Throughout
Addition of description about pin processing in 3.2.17 VPP (flash memory version only) Modification of I/O circuit types of P32 and P33 in Table 3-1 Pin I/O Circuit Types Addition of description about pin processing in 4.2.17 VPP (flash memory version only)
CHAPTER 4 PIN FUNCTION (PD780078Y SUBSERIES)
Addition of description about programming area in 5.1.2 (1) Internal high-speed RAM and (2) Internal expansion RAM Modification of Figure 5-10 Data to Be Saved to Stack Memory and Figure 5-11 Data to Be Restored from Stack Memory Modification of [Description example] in 5.4.4 Short direct addressing Addition of [Illustration] in 5.4.7 Based addressing, 5.4.8 Based indexed addressing, and 5.4.9 Stack addressing Modification of port block diagrams (Figure 6-2 Block Diagram of P00 to P03 to Figure 6-21 Block Diagram of P80) Addition of Table 6-6 Port Mode Registers and Output Latch Setting When Alternate Function Is Used Addition of description of internal feedback resistor and oscillation stabilization time select register (OSTS) in 7.3 Clock Generator Control Register Deletion of 8.5.6 One-shot pulse output operation in the previous edition Modification of Figure 8-1 Block Diagram of 16-Bit Timer/Event Counter 00 and Figure 8-2 Block Diagram of 16-Bit Timer/Event Counter 01 Change of Table 8-2 TI00n Pin Valid Edge and CR00n, CR01n Capture Trigger and Table 8-3 TI01n Pin Valid Edge and CR00n Capture Trigger in the previous edition to Table 8-2 CR00n Capture Trigger and Valid Edges of TI00n and TI01n Pins and Table 8-3 CR01n Capture Trigger and Valid Edge of TI00n Pin (CRC02n = 1) Change of explanation order of each function in 8.4 Operation of 16-Bit Timer/ Event Counters 00, 01 Addition of Figure 8-31 PPG Output Configuration Diagram and Figure 8-32 PPG Output Operation Timing
CHAPTER 5 CPU ARCHITECTURE
CHAPTER 6 PORT FUNCTIONS
CHAPTER 7 CLOCK GENERATOR CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01
User's Manual U14260EJ3V1UD
589
APPENDIX E
REVISION HISTORY
(2/4)
Edition 2nd Addition of 8.5 Program List Modification of 8.6 (3) Capture register data retention timing Addition of (11) STOP mode or main system clock stop mode setting Modification of Figure 9-1 Block Diagram of 8-Bit Timer/Event Counter 50 and Figure 9-2 Block Diagram of 8-Bit Timer/Event Counter 51 Deletion of Caution in Figure 9-5 Format of 8-Bit Timer Mode Control Register 50 (TMC50) and Figure 9-6 Format of 8-Bit Timer Mode Control Register 51 (TMC51) Addition of [Setting] in 9.4.2 External event counter operation Addition of description about frequency to [Setting] in 9.4.3 Square-wave output (8-bit resolution) operation Addition of descriptions about frequency and duty ratio to [Setting] in 9.4.4 8-bit PWM output operation Addition of 9.5 Program List Deletion of 9.6 (2) Operation after compare register transition during timer count operation in the previous edition Deletion of oscillation stabilization time select register (OSTS) from 11.4 Registers to Control Watchdog Timer in the previous edition Modification of Figure 12-1 Block Diagram of Clock Output/Buzzer Output Controller CHAPTER 11 WATCHDOG TIMER CHAPTER 12 CLOCK OUTPUT/BUZZER OUTPUT CONTROLLER CHAPTER 13 A/D CONVERTER Contents Applied to: CHAPTER 8 16-BIT TIMER/EVENT COUNTERS 00, 01 CHAPTER 9 8-BIT TIMER/ EVENT COUNTERS 50, 51
Addition of Figure 13-2 Format of A/D Conversion Result Register 0 (ADCR0) Modification of description in 13.2 (3) Sample & hold circuit and (4) Voltage comparator, and addition of (9) ADTRG pin Addition of Table 13-2 ADCS0 and ADCE0 Settings and Figure 13-4 Timing Chart When Boost Reference Voltage Generator Is Used Addition of Table 13-3 Sampling Time and A/D Conversion Start Delay Time of A/D Converter Deletion of 13.6 (4) Noise countermeasures (those deleted are added to Figure 13-20 Example of Connecting Capacitor to AVREF Pin and Figure 13-22 Example of Connection When Signal Source Impedance Is High) Addition of (13) Input impedance of ANI0 to ANI7 pins Modification of Figure 14-1 Block Diagram of Serial Interface UART0 Shift of description about asynchronous serial interface status register 0 (ASIS0) from 14.3 Registers to Control Serial Interface UART0 to 14.2 Configuration of Serial Interface UART0 Addition of Caution in Figure 14-7 Error Tolerance (When k = 0), Including Sampling Errors Modification of Caution in Figure 14-10 Timing of Asynchronous Serial Interface Receive Completion Interrupt Request Addition of (1) Registers to be used and (3) Relationship between main system clock and baud rate in 14.4.3 Infrared data transfer mode Addition of Table 14-6 Register Settings
CHAPTER 14 SERIAL INTERFACE UART0
590
User's Manual U14260EJ3V1UD
APPENDIX E
REVISION HISTORY
(3/4)
Edition 2nd Contents Modification of Figure 15-1 Block Diagram of Serial Interface UART2 Shift of descriptions about asynchronous serial interface status register 2 (ASIS2) and asynchronous serial interface transmit status register 2 (ASIF2) from 15.3 Registers to Control Serial Interface UART2 to 15.2 Configuration of Serial Interface UART2 Modification of Caution 1 and addition of Cautions 2 and 3 in Figure 15-4 Format of Asynchronous Serial Interface Transmit Status Register 2 (ASIF2) Addition of Notes 7 and 8 in Figure 15-8 Format of Transfer Mode Specification Register 2 (TRMC2) Modification of error values in Table 15-2 Relationship Between Main System Clock and Baud Rate Addition of Caution in Table 15-3 Maximum Permissible Baud Rate Error and Minimum Permissible Baud Rate Error Modification of the INTST2 timing in (ii) and (iii) of Figure 15-12 Timing of Asynchronous Serial Interface Transmit Completion Interrupt Request Division of Table 15-6 Transmission Status and Writing to TXB2 in the previous edition into Table 15-4 Writing to TXBF and TXB2 (When Successive Transmission Is Started) and Table 15-5 Writing to TXSF and TXB2 (When Successive Transmission Is in Progress) Modification of Figure 15-14 Timing of Starting Successive Transmission Modification of Figure 15-15 Timing of Completing Successive Transmission Modification of Figure 15-17 Receive Error Timing Addition of Table 15-10 Register Settings Modification of Figure 16-1 Block Diagram of Serial Interface SIO3 Addition of Notes 3 and 4 in Figure 16-2 Format of Serial Operation Mode Register 3 (CSIM3) Addition of Table 16-2 Register Settings Modification of Figure 17-1 Block Diagram of Serial Interface CSI1 Addition of description about SS1 pin in 17.4.2 (2) Communication operation Modification of Figure 17-6 Timing of 3-Wire Serial I/O Mode Modification of Figure 17-8 Output Operation of First Bit Modification of Figure 17-9 Output Value of SO1 Pin (Last Bit) Deletion of 17.4.2 (6) SCK1 pin and (7) SO1 pin in the previous edition Addition of Table 17-2 Register Settings Modification of Figure 18-1 Block Diagram of Serial Interface IIC0 Incorporation of 18.3 (4) IIC shift register 0 (IIC0) and (5) Slave address register 0 (SVA0) in the previous edition into 18.2 (1) IIC shift register 0 (IIC0) and (2) Slave address register 0 (SVA0), respectively Addition of description to "Transfer Lines" in Figure 18-16 Wait Signal Addition of descriptions to Notes 1 and 2 in Table 18-2 INTIIC0 Timing and Wait Control Modification of Figure 18-21 Master Operation Flowchart and Figure 18-22 Slave Operation Flowchart CHAPTER 18 SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY) CHAPTER 17 SERIAL INTERFACE CSI1 CHAPTER 16 SERIAL INTERFACE SIO3 Applied to: CHAPTER 15 SERIAL INTERFACE UART2
User's Manual U14260EJ3V1UD
591
APPENDIX E
REVISION HISTORY
(4/4)
Edition 2nd Contents Modification of 18.5.16 (3) (d) (ii) When WTIM0 = 1 (after restart, does not match with address (= not extension code)) Modification of (1) Start condition ~ address and (2) Data in Figure 18-23 Example of Master to Slave Communication (When 9-Clock Wait Is Selected for Both Master and Slave) Modification of Figure 18-24 Example of Slave to Master Communication (When 9-Clock Wait Is Selected for Both Master and Slave) Modification of (E) Software interrupt in Figure 19-1 Basic Configuration of Interrupt Function Addition of Cautions 3 and 4 in Figure 19-2 Format of Interrupt Request Flag Register (IF0L, IF0H, IF1L) Addition of Caution in Figure 19-5 Format of External Interrupt Rising Edge Enable Register (EGP), External Interrupt Falling Edge Enable Register (EGN) Addition of description and Remark in 19.4.1 Non-maskable interrupt request acknowledgment operation Addition of description in 19.4.2 Maskable interrupt acknowledgment operation Addition of item to Table 19-4 Interrupt Requests Enabled for Multiple Interrupt Servicing Addition of description about when using expanded-specification products CHAPTER 20 EXTERNAL DEVICE EXPANSION FUNCTION CHAPTER 21 STANDBY FUNCTION CHAPTER 19 INTERRUPT FUNCTIONS Applied to: CHAPTER 18 SERIAL INTERFACE IIC0 (PD780078Y SUBSERIES ONLY)
Addition of clock output and buzzer output in Table 21-1 HALT Mode Operating Statuses Modification of clock output in Table 21-3 STOP Mode Operating Statuses Modification of chapter
CHAPTER 23 PD78F0078, 78F0078Y CHAPTER 25 ELECTRICAL SPECIFICATIONS CHAPTER 26 PACKAGE DRAWINGS CHAPTER 27 RECOMMENDED SOLDERING CONDITIONS
Addition of chapters
Addition of Table A-2 Major Differences Between PD78018F, 780024A, 780034A, and 780078 Subseries (Software)
APPENDIX A DIFFERENCES BETWEEN PD78018F, 780024A, 780034A, AND 780078 SUBSERIES APPENDIX B DEVELOPMENT TOOLS APPENDIX C NOTES ON TARGET SYSTEM DESIGN APPENDIX E REVISION HISTORY
Modification of chapter
Addition of chapters
592
User's Manual U14260EJ3V1UD


▲Up To Search▲   

 
Price & Availability of UPD78F0078

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X